How to get Instance count

Hello,

How can I get the Instances count of a deployment?

Thanks

February 12th, 2012 5:55pm

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

Free Windows Admin Tool Kit Click here and download it now
February 12th, 2012 6:22pm

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.



February 12th, 2012 6:26pm

Should be something like RoleEnvironment.CurrentRoleInstance.Role.Instances.
  • Marked as answer by AzureMtl Sunday, February 12, 2012 9:11 PM
Free Windows Admin Tool Kit Click here and download it now
February 12th, 2012 7:16pm

I always get 1 instance, in dev.

But I`ll try it on the cloud.

February 12th, 2012 7:48pm

In dev, you also have only one instance running!
Free Windows Admin Tool Kit Click here and download it now
February 12th, 2012 9:07pm

In dev, you also have only one instanc
February 12th, 2012 10:59pm

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.

Free Windows Admin Tool Kit Click here and download it now
February 14th, 2012 8:32am

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


April 3rd, 2015 9:10pm

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics