Ask Your Question
1

How can a classic service be stopped using Azure REST API?

asked 2023-04-29 11:38:05 +0000

ladyg gravatar image

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2023-04-29 11:40:02 +0000

qstack gravatar image

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.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account. This space is reserved only for answers. If you would like to engage in a discussion, please instead post a comment under the question or an answer that you would like to discuss

Add Answer


Question Tools

Stats

Asked: 2023-04-29 11:38:05 +0000

Seen: 10 times

Last updated: Apr 29 '23