获取 webrole 所属部署的名称和位置
我希望能够从正在运行的 Web 角色中获取部署的名称(在创建托管服务时命名)和位置(北欧、亚洲等)。我不想依赖证书和订阅 ID。
类似于:
// Current role name. Ex: WebRole_IN_0
RoleEnvironment.CurrentRoleInstance.Id
// Deployment id of the role. Ex: 44b522f7e8b94412b046bbab08116d87
RoleEnvironment.DeploymentId
但只返回部署名称和部署位置。
这是否可以在不使用订阅 ID 和证书文件通过 REST api 的情况下实现?
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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
不,如果不使用服务管理 API,则无法完成此操作。为什么不把它放在配置设置中呢?部署后无法更改...
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...