- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
How to change Azure Subscription in PowerShell?
To change the azure subscription using PowerShell, we can use the Select-AZSubscription command. When you use this command, you can use either the subscription ID, Subscription Name, or the Tenant ID.
Example
With Subscription Name,
Select-AzSubscription -SubscriptionName 'Visual Studio'
With TenantID,
Select-AzSubscription -Tenant 'XXXX-XXXXX-XXXXXXX-XXXX'
With Subscription ID,
Select-AzSubscription -SubscriptionId 'XXXX-XXXXX-XXXXXXX-XXXX'
Sometimes on console messages will appear that one or more subscriptions are active. In that case, you can switch the other subscription using the Set-AZContext command and you can use subscription ID or the Name for it.
Example
Set-AzContext -SubscriptionId "xxxx-xxxx-xxxx-xxxx"
Or
Set-AzContext -SubscriptionName "Visual Studio"
- Related Articles
- How to connect to the Azure subscription using Azure CLI in PowerShell?
- How to retrieve the Azure VM Subscription Name using PowerShell?
- How to change the Azure tag value using PowerShell?
- How to change the size of the Azure VM using PowerShell?
- How to list the Azure VMs using Azure CLI in PowerShell?
- How to deallocate the Azure VM using Azure CLI in PowerShell?
- How to start the Azure VM using Azure CLI in PowerShell?
- How to stop the Azure VM using Azure CLI in PowerShell?
- How to restart the Azure VM using Azure CLI in PowerShell?
- How to resize the Azure VM using Azure CLI in PowerShell?
- How to Install Azure PowerShell Cmdlets?
- How to get the Azure resource group using Azure CLI in PowerShell?
- How to get the Azure VM Size using Azure CLI in PowerShell?
- How to get the Azure VM username using Azure CLI in PowerShell?
- How to delete the azure blob (File) using Azure CLI in PowerShell?

Advertisements