When you have multiple Azure Subscriptions, you can set your default subscription using PowerShell. In this article, let me walk you through the quick steps to set Azure subscription in powershell.
Table of Contents
How To Set Subscription In Azure PowerShell
To set subscription in Azure PowerShell, follow the below steps.
1. Open PowerShell ISE with Run As Administrator mode.

2. Run the below PowerShell command to get your Azure subscriptions list.
Get-AzSubscriptionAfter executing the above Get-AzSubscription command, I successfully got the Azure subscriptions list, as shown below.

3. we can now use the Set-AzContext command along with the subscription name or ID to set the default subscription. We can execute the below command for that.
Set-AzContext -SubscriptionName "Visual Studio Enterprise"After executing the above command, I got the expected output, which is shown in the screenshot below.

Or, we can also use the SubscriptionID instead of Subscription name as per the below script.
Set-AzContext -SubscriptionId "1cdf4300-dee5-4518-9c9c-feaa72a5cbd1"After executing the above command, I got the expected output, as shown in the screenshot below.

You can also use the Select-AzSubscription to set the current subscription using the PowerShell command below.
Select-AzSubscription -SubscriptionId "1cdf4300-dee5-4518-9c9c-feaa72a5cbd1"After executing the above command, I got the expected output, as shown in the screenshot below.

Video Tutorial
Conclusion
Setting subscription Azure using PowerShell is so easy using the Set-AzContext and Select-AzSubscription (old method). It is suggested to use the Set-AzContext PowerShell command as mentioned in this article.
You may also like following the articles below.
- How to rename Azure Subscription
- The term ‘get-azuresubscription’ is not recognized
- Select-AzureSubscription
- The term ‘Select-AzureSubscription’ is not recognized as the name of a cmdlet

I am Rajkishore, and I am a Microsoft Certified IT Consultant. I have over 14 years of experience in Microsoft Azure and AWS, with good experience in Azure Functions, Storage, Virtual Machines, Logic Apps, PowerShell Commands, CLI Commands, Machine Learning, AI, Azure Cognitive Services, DevOps, etc. Not only that, I do have good real-time experience in designing and developing cloud-native data integrations on Azure or AWS, etc. I hope you will learn from these practical Azure tutorials. Read more.
