Get a cloud service name in a web role

We have a requirement to register the name of the cloud service in which the web role is deployed.
We get the role identifier and role name from the RoleEnvironment class in the Azure ServiceRuntime library. But do not find the name of the cloud service.

+4
source share
1 answer

You cannot find this information with the class RoleEnvironment. For this you need to use Service Management API. Basically, this is an attempt to get the deployment identifier from the class RoleEnvironment, and then call the Service Management API operations for

  • First specify cloud services in the subscription
  • , .
  • .

.

API Service Management, Azure Management Library REST-. , REST API: http://gauravmantri.com/2012/03/16/programmatically-finding-deployment-slot-from-code-running-in-windows-azure/.

+6

Source: https://habr.com/ru/post/1546777/


All Articles