Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

To stop a classic service using Azure REST API, you will need to follow these steps:

  1. Authenticate and obtain an Access Token to use Azure REST API.

  2. Send a DELETE request to the following endpoint using the obtained Access Token:

https://management.core.windows.net/{subscription-id}/services/hostedservices/{cloud-service}/deployments/{deployment-name}

Replace {subscription-id} with your Subscription ID, {cloud-service} with the name of the cloud service and {deployment-name} with the name of the deployment.

  1. Set the headers for the request as follows:
Content-Type: application/xml
x-ms-version: 2015-04-01
Authorization: Bearer {Access-Token}

Replace {Access-Token} with the Access Token obtained in Step 1.

  1. Include the following XML in the request body:
<DeleteDeployment xmlns="http://schemas.microsoft.com/windowsazure">
  <deleteAllRoles>true</deleteAllRoles>
</DeleteDeployment>

This XML specifies that all roles should be deleted along with the deployment.

  1. Send the request and wait for a response.

If the request is successful, you will receive a 200 OK response indicating that the deployment has been deleted.