Select-AzureSubscription

In this Azure PowerShell article, we will discuss the syntax and usage of the Select-AzureSubscription PowerShell command with examples of how to use this command to change Azure Subscription in PowerShell.

Select-AzureSubscription

This command can help you to set and clears your current and the default Azure subscriptions.

Syntax of Select-AzureSubscription

Below is the syntax of the Select-AzureSubscription PowerShell command.

Select-AzureSubscription
 -SubscriptionName <String>
Select-AzureSubscription
 -SubscriptionId <String>

Let’s discuss a few examples of how to use the Select-AzureSubscription PowerShell command.

Example-1:

You can execute the below PowerShell command to set the specified subscription name as the current subscription.

Select-AzureSubscription -Current -SubscriptionName "Visual Studio Enterprise"

After executing the above command, I got the below-expected output. The specified subscription name has been set as the current subscription.

Select-AzureSubscription

Example-2:

You can run the Azure PowerShell command below to set the specified subscription as the default one.

Select-AzureSubscription -Default -SubscriptionName "Visual Studio Enterprise"

After executing the PowerShell command, I got the expected output below.

select-azuresubscription -default

Select-AzureSubscription – Video Tutorial

You can also check out a video tutorial on the Select-AzureSubscription PowerShell Command.

Final Thoughts

In this Azure PowerShell article, we discussed the syntax and usage of the Select-AzureSubscription PowerShell command with examples of how to use this command.