开发者

Getting the name and location of the deployment the webrole belongs to

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 rol开发者_JAVA技巧e 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?


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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜