Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
Know Your Cloud Resource Costs on Azure
public async Task<IEnumerable<ResourceGroup>> GetResourceGroupsAsync(string subscriptionId, string authToken)
{
var credentials = new TokenCredentials(authToken);
using (var client = new ResourceManagementClient(credentials) { SubscriptionId = subscriptionId })
{
var rgs = await client.ResourceGroups.ListAsync().ConfigureAwait(false);
return rgs.ToArray();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment