3

As a follow up to my question about Deployment Status, I'd like to ask if there is a fast way to find:

  • Current Subscription Id
  • The current deployment slot the role is in (Staging/Production)

I am currently using the Management API, which is a bit slow, but I don't want to cache it for long because I can't be sure the cache will invalidate upon the slot swap.

Community
  • 1
  • 1
Anže Vodovnik
  • 2,325
  • 16
  • 25

1 Answers1

2

From a running instance, you might be able to tell if you are in staging/production from the host URL for a web role. If you see your deployment ID there, it is staging. However, this can get tricky if you are using CNAMEs or you are running a worker role. For subscription ID, there is not much you can do as that is a pre-cursor to everything. You can't even use the Mgmt API if you don't know your SubID (there is no way that I am aware of to get the subscription ID other than portal).

Seems like the management API is your best bet (and only bet in some cases).

dunnry
  • 6,858
  • 1
  • 20
  • 20