Fetching Azure Subscription ID & Deployment Slot (really fast)

前端 未结 1 847
南旧
南旧 2021-01-20 07:31

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 c
相关标签:
1条回答
  • 2021-01-20 07:54

    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).

    0 讨论(0)
提交回复
热议问题