question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[FEATURE REQ] Ability to use Default Subscription ID when creating management client

See original GitHub issue

Library or service name. Azure.ResourceManager.Storage

Is your feature request related to a problem? Please describe. When using the Fluent API, I can do this:

            return Microsoft.Azure.Management.Fluent.Azure
                .Authenticate(credentials)
                .WithDefaultSubscription();

Which picks the default subscription (presumably based on the given credentials); my application doesn’t have to know its subscription id.

However, with the new libraries, the API (seemingly) requires subscription ID to create a new management client:

image

which means I now have to have the Subscription ID for my application stored as an env var, etc in order to use the new management libraries. This will block us from using the new Management SDKs.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:8 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
riezeboschcommented, Aug 26, 2022

Looks like fixed in Azure.ResourceManager@1.3.0 && Azure.ResourceManager.Storage@1.0.0-beta.12:

var subscription = await new ArmClient(new DefaultAzureCredential()).GetDefaultSubscriptionAsync();
var rg = await subscription.GetResourceGroup("<...>");
var storage = await rg.Value.GetStorageAccountsAsync();
1reaction
jsquirecommented, Aug 25, 2020

Hi Brandon. Thanks for opening this. Tagging and routing to the team member best able to assist.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Grant access to create Azure Enterprise subscriptions
Learn how to give a user or service principal the ability to programmatically create Azure Enterprise subscriptions.
Read more >
Subscriptions in Azure API Management
Enable or disable subscription requirement for API or product access. By default when you create an API, a subscription key is required for...
Read more >
Best practices for using service accounts - IAM
This guide presents best practices for managing, using, and securing service accounts. Choose when to use service accounts. Not every scenario requires a ......
Read more >
Stripe API reference – Create a subscription
ID of the default payment method for the subscription. It must belong to the customer associated with the subscription. This takes precedence over ......
Read more >
InfoWorld - Apr 27, 1998 - Page 127 - Google Books Result
THE DISCOVERER 3.1 administration tools let IT staffers closely manage the ... using the end-user portion of Discoverer and was able to easily...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found