5

I want to be able to get the name (named when the hosted service was created) and the location (North Europe, Asia Anywere, etc) of the deployment from within a running web role. I don't want to rely on a certificate and the subscription ID.

Something like:

// Current role name. Ex: WebRole_IN_0
RoleEnvironment.CurrentRoleInstance.Id

// Deployment id of the role. Ex: 44b522f7e8b94412b046bbab08116d87
RoleEnvironment.DeploymentId 

but just returning the deployment name and deployment location.

Is this possible without going through the REST api using the subscription ID and a certificate file?

David Makogon
  • 69,407
  • 21
  • 141
  • 189

1 Answers1

3

No, this can't be done without using the Service Management API. Why not just put it in configuration settings? It can't change after deployment...

user94559
  • 59,196
  • 6
  • 103
  • 103
  • +1 - not because I liked it, but it is correct. Having web roles be able to identify their deployment name or geographical location would be nice. Trying to do it by IP does not seem to work - a North Europe web role gets located in the US by http://www.geoiptool.com/en/?IP=65.52.231.154 – mawtex Jun 30 '11 at 21:19
  • I was afraid that this was the answer, but thanks for it any ways :) – Martin Ingvar Kofoed Jensen Jul 01 '11 at 07:22