Hello,
How can I get the Instances count of a deployment?
Thanks
Technology Tips and News
Hello,
How can I get the Instances count of a deployment?
Thanks
Hi,
What do you mean exactly?
Using the current configuration, you can see the number of running instances.
If you want to do it programmatically, I would start off using the "Get Hosted Services Properties"
Hope it helps
Hello Thanks Dampee.
Yes programmatically, yes tried the Service Management API, I could get all sort of information, but I don't seem to find the current instances count.
I always get 1 instance, in dev.
But I`ll try it on the cloud.
In dev, you also have only one instanc
You need to use Get Deployment operation (http://msdn.microsoft.com/en-us/library/ee460804.aspx) and then parse Configuration element of response body to get Instances count.
You can use my POSOlSoft.Azure.ServiceManagement free .NET library (http://www.posolsoft.com/products/ServiceManagement.htm) to perform Get Deployment operation.
You can use the Azure .Net SDK which wraps their REST API. Specifically, the ComputeManagementClient can be used as follows:
DeploymentGetResponse prodDeployResponse = computeClient.Deployments.GetBySlot("YourServiceName", DeploymentSlot.Production);
int instanceCount = prodDeployResponse.RoleInstances.Count;
https://msdn.microsoft.com/en-us/library/microsoft.windowsazure.management.compute.computemanagementclient(v=azure.11).aspx