Next steps. If you don’t have it yet, you can install it using PowerShellGet; An established connection to Azure using the Connect-AzAccount cmdlet; Like me, you became a big fan of Resource Graph to explore the resources of your Azure subscriptions. If you wish to list all the virtual machines in an Azure subscription, execute the “Get-AzVM” command in an elevated PowerShell window. Think: “If you run this command out of context it might not work.” Simply put, a context is a subscription… You must have an Owner or Contributor role on the Enrollment Account you wish to see subscriptions under. Summary: Use Windows PowerShell to get the name of cmdlets referring to your Azure subscription.. Is there an easy way to obtain the Azure cmdlets referring to my subscription name? If you would like to list virtual machines from Resource Groups listed in a text file, using the following PowerShell script would work: When writing PowerShell Scripts with the “Az” or “AzureRM” PowerShell modules, a context is how you Azure knows which subscription the commands should affect. If you have multiple subscriptions, you can access them … If you have more than 1,000 Azure subscriptions, there’s a problem, since an ARG query – sent via either Powershell or Azure CLI – will only run against 1,000 of them. Azure role-based access control (Azure RBAC) is the way that you manage access to resources in Azure. This was fruitless. The latest version as of this post is 2.6.0. This module must be installed in your machine. You should be able to use the new Get-AzSubscriptions powershell command to list all the subscriptions your account can access. Use the Get-AzureSubscription cmdlet and access the SubscriptionName property: (Get-AzureSubscription).subscriptionname. The output will display the names and IDs. Get Subscription . Figuring it to be a permissions issue I spent 20 minutes comparing my assigned roles for my user account and tried a few different things. To conclude, in this article we have learned how to list the Azure subscriptions on the local machine, and once the subscription is set, how to select the current and default subscription, how to check the current and default subscriptions currently configured in PowerShell. To set the subscription run the following command with the name of the subscription. Now nothing is perfect, and even less on Azure, it still lacks features including this one: Resource Graph type for Management Groups This type would be practical for example to list all the subscriptions present in a Management Group. For more information, see Add or remove Azure role assignments using Azure PowerShell. It might not have any Policy or Role Assignments being inherited, but it will be child of a MG. As for the list you can do this in powershell … See our docs on how to Programmatically create Azure Enterprise subscriptions (preview). An Azure subscription. get-azsubscription Set Subscription . To learn Azure Resource Manager, see Azure Resource Manager overview. The first step in setting you Azure subscription in PowerShell is to first list all the subscription you have using the following command. Azure PowerShell module. Azure Functions – Programmatically List All Subscriptions in Your Tenant Using Resource Graph & C# Posted on August 7, 2020 August 10, 2020 Author stefanroth Comment(0) Recently I have been working quite a bit with Azure Functions and C#. This is described here, along with a very elegant solution, that’s grouping the Azure subscriptions into small enough batches so that the limitation is bypassed. The resulting list was only showing me a handful of subscriptions. All subscriptions will be within the Management Group hierarchy, so there should not be a subscription that is not managed.