user2326106 February 2016

Is there a C# sdk/wrapper for Azure Resource Management API calls?

I want to execute resource group based calls. For example:

Azure Management Libraries don't seem to have this capability (unless I'm missing something). Is there any SDK or client wrapper available that can make that kind of call?

EDIT: Gaurav pointed me at exactly what I needed. Going to do people a solid and expand upon what I did to help clear the muddy muddy waters that is the Azure Resource Management API.

In your app's Packet Manager do: Install-Package Microsoft.Azure.Management.Resources -Pre Then Install-Package Microsoft.Azure.Management.Compute -Pre Then Install-Package Microsoft.IdentityModel.Clients.ActiveDirectory -Pre

Follow this blog for getting an authorization header/token:

Then call the new API like so (note the slight name changes):

class Program
    static void Main(string[] args)
        var token = GetAuthorizationHeader();
        var credential = new Microsoft.Rest.TokenCredentials(token);
        using (var client = new ComputeManagementClient(credential) { SubscriptionId = ConfigurationManager.AppSettings["subscriptionId"] })
            var vms = client.VirtualMachines.ListAll();

    private static string GetAuthorizationHeader()
        AuthenticationResult result = null;

        var context = new AuthenticationContext("" + ConfigurationManager.AppSettings["tenantId"]);

        string clientId = ConfigurationManager.AppSettings["clientId"];
        string clientSecret = ConfigurationManager.AppSettings["clientSecret"];
        ClientCredential clientCred = new ClientCredential(clientId, clientSecret);



Gaurav Mantri February 2016

I believe the package you're looking for is Microsoft.Azure.Management.Resources 3.4.0-preview. You can find the complete source code for Azure Resource Manager here:

Post Status

Asked in February 2016
Viewed 2,761 times
Voted 14
Answered 1 times


Leave an answer