开发者

How can I find all deployments running in my Azure environment?

开发者 https://www.devze.com 2023-02-07 17:50 出处:网络
I\'m trying to write a small code in c#开发者_JAVA技巧 to find all deployments running under a specific subscription in Azure.

I'm trying to write a small code in c#开发者_JAVA技巧 to find all deployments running under a specific subscription in Azure. I did find the RoleEnvironment class of Microsoft.WindowsAzure.ServiceRuntime Namespace that can provide me with the roles under my environment. But can anyone help me with finding what deployments are currently running and how to get their IDs?

10x,
Nava


You can use the Windows Azure Service Management API for things like that.

AFAIK the current SDK (1.3) have no managed classes that wrap the REST API, so you'll need to code directly against the HTTP stack. It's not particularly hard, though.

To list all services under a specific subscription you can use the List Hosted Services operation.


If you don't want to write the wrappers for the REST API yourself, you can use the samples provided by Microsoft. The include samples of service management amongst many others. Bear in mind that this is just sample code so not all of it is production ready. I haven't had any issues using the management samples though as it's all pretty basic stuff.

Another gotcha is that what properties are called in the portal, doesn't match what they're called in the API. e.g. what is referred to as Name in the portal is Label in the API and ID in the portal is Name in the API.


There is a pretty cool Visual Studio add-in that does this, among other things. Check it out here:

http://clumsyleaf.com/products/azurexplorer

0

精彩评论

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

关注公众号