I have to replace the service management API's with Azure ARM and I am finding very difficult to find a proper documentation for the following equivalent Azure ARM API's
1) ComputeManagementClient.Deployments.Create - I found the API to GET deployment by slot with the help of azure resource explorer.
https://management.azure.com/subscriptions/{mySubID}/resourceGroups/{myResourcegroup}/providers/Microsoft.ClassicCompute/domainNames/{myCloudService}/slots/Production?api-version=2016-04-01
What is PUT/POST request body for the same ?
2) ComputeManagementClient.Deployments.swap - What is the API to Swap deployment with Production slot ?
3) ComputeManagementClient.HostedServices.Create
https://management.azure.com/subscriptions/{mySubID}/resourceGroups/{myResourcegroup}/providers/Microsoft.ClassicCompute/domainNames/{myCloudService}/slots/Production?api-version=2016-04-01
Will the above API create cloud service ? If so what are the parameters should be in the Request body ?
To create deployment slot you can adapt this arm template piece (properties would be the body, path would be combination of name + type), refer to this for some additional examples:
Also, your best source of such information is fiddler ;) ( at least that how I got to know it )
For Deployments.Create please refer to 4c74356b41's answer. I test the create cloudservice and swap slot on my side, it works correctly.
please have a try to use the following REST API to swap the deployment with Production slot.
Yes, we could use the Rest API to create cloudservice.
Body:
Note: please make sure that your subcription supports to create the cloudservice in that location. If it is not supported, we will get the following error.