In order to automate a process in my cloud deployment, I need to stop and start a cloud service (that archives data) very often through code. Currently, I stop and start that cloud service manually using the Azure Management Portal. I want this to be done through my another cloud service that processes the input data.
The azure cloud service that I am trying to stop and start has one deployment (PRODUCTION).
There is only limited information available in google on how to do this.
I tried the following MSDN website(Azure REST API) to toggle the deployment status between "Running" and "Suspended", but, I am getting a "Bad Request" error when I implement exactly as described in this website (MSDN does not allow me to post the website details).
Can any one of you point me to the right direction on how to stop/start azure cloud service through code?
Bad Requesterror usually mean there's something wrong with the way request is sent to Service Management API (missing required header, malformed request body etc.). Can you paste your code here? Also, if you read the response contents of web exception, you will see more details about the error. - Gaurav Mantri