according to https://video2.skills-academy.com/en-us/powershell/module/az.accounts/get-azsubscription?view=azps-5.7.0 you can do this
PS C:\>Get-AzSubscription
Name Id TenantId State
Subscription1 yyyy-yyyy-yyyy-yyyy aaaa-aaaa-aaaa-aaaa Enabled
Subscription2 xxxx-xxxx-xxxx-xxxx aaaa-aaaa-aaaa-aaaa Enabled
Subscription3 zzzz-zzzz-zzzz-zzzz bbbb-bbbb-bbbb-bbbb Enable
what api does this program use to enumerate subscriptions in a tenant? i cannot get results from /subscriptions from neither the azure graph nor the microsoft graph.
the reason i want to know is because i'm writing an azure storage account management tool, and the azure management sdk starting point is as below, and you the credentials have to be associated with a subscriptionid - i want to avoid making the user type those
please advise
string token = GetAuthorizationHeader();
TokenCredentials credential = new TokenCredentials(token);
ResourceManagementClient resourcesClient = new ResourceManagementClient(credential) { SubscriptionId = subscriptionId };
StorageManagementClient storageMgmtClient = new StorageManagementClient(credential) { SubscriptionId = subscriptionId };