We can easily switch the subscription in Azure using the Set-AzContext and Select-AzSubscription PowerShell commands. In this article, let me walk you through the quick steps.
Table of Contents
How To Switch Subscription In Azure PowerShell
To switch subscription in Azure PowerShell, follow the below steps.
1. Open Windows PowerShell ISE with Run as administrator mode.
You can use the Get-AzSubscription command to see the Azure subscriptions list.
2. Now, we can execute the below PowerShell command to switch subscriptions.
Set-AzContext -SubscriptionId "1cdf4300-dee5-4518-9c9c-feaa72a5cbd1"After executing the above PowerShell command, I got the expected output, as shown below.

We can also use the subscription name instead of the subscription ID, as shown in the screenshot below. We got the expected output.
Set-AzContext -SubscriptionName "Visual Studio Enterprise"
We can also use the Select-AzSubscription like the one below.
Select-AzSubscription -SubscriptionId "1cdf4300-dee5-4518-9c9c-feaa72a5cbd1"
We can also use the subscription name instead of the subscription ID along with the Select-AzSubscription command, as mentioned below.
Select-AzSubscription -SubscriptionName "Visual Studio Enterprise"
FAQs
Which PowerShell cmdlet can be used to switch to a specific Azure subscription?
Set-AzContext, Select-AzSubscription
Conclusion
To switch subscription in Azure PowerShell, we can use Set-AzContext and Select-AzSubscription PowerShell commands as mentioned in this article.
You may also like following the articles below.
- How To Check Current Subscription In Azure PowerShell
- Azure PowerShell Where-Object
- How To Set Subscription In Azure PowerShell
- The term ‘Select-AzureSubscription’ is not recognized as the name of a cmdlet
- The term ‘get-azuresubscription’ is not recognized

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.
