Even asking this question, I wonder how something so complicated can be so difficult for me. All I want to do is automate the scheduled shutdown and start of Azure WebSite. First I looked at WebJobs and created a powershell script file that would stop WebSite, which used the stop-azurewebsite cmdlet:
stop-azurewebsite [my site]
Then I created a .cmd file to call it with powershell.exe to execute the powershell file
PowerShell.exe -ExecutionPolicy RemoteSigned -File stopit.ps1
I created WebJob to run the powershell command to stop the site, but it made a mistake with the message:
stop-azurewebsite : The term 'stop-azurewebsite' is not recognized as the name
of a cmdlet, function, script file, or operable program. Check the spelling of
the name, or if a path was included, verify that the path is correct and try
again.
So, I decided that I would go on the REST API route. I made a send request using the violinist and the appropriate management certificate to call:
https://management.core.windows.net/[my subscription id]/services/WebSpaces/[webspace]/sites/[website name]/stop
, "" . "", . , , , ( ) Azure WebSite ?
UPDATE:
, http, , PUT
https://management.core.windows.net/[my subscription id]/services/WebSpaces/[webspace]/sites/[website name] {"State":"Stopped"}, "PUT`ing" URL- WebJob.