C
ClearView News

How do I change the default subscription for Azure PowerShell?

Author

James Holden

Published Feb 25, 2026

How do I change the default subscription for Azure 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.

Herein, how do I change my Azure PowerShell subscription?

Change the active subscription

In order to change subscriptions, an Azure PowerShell Context object first needs to be retrieved with Get-AzSubscription and then the current context changed with Set-AzContext.

Additionally, can you rename an Azure subscription? Sign in to the Azure portal, select Subscription from the left pane, and then select the subscription that you want to rename. Select Overview, and then select Rename from the command bar. After you change the name, select Save.

Subsequently, one may also ask, how do I change my default subscription in Azure?

Go to the old portal. and then select Subscriptions at the top of the screen and from FILTER BY DIRECTORY make sure you're selecting you own subscription -the one you're the admin of it, not a co admin- then select Manage subscriptions/directory.

How do I check my Azure PowerShell subscription?

In this article

  1. Get a list of all subscriptions in your account. Azure PowerShell Copy. Try It. Get-AzureRmSubscription.
  2. Set the default. Azure PowerShell Copy. Try It. Select-AzureRmSubscription -Subscription "My Demos"
  3. Verify the change by running the Get-AzureRmContext cmdlet. Azure PowerShell Copy. Try It.

How do I connect my Azure subscription to PowerShell?

In order to connect your Azure Subscription with Powershell, you need to follow the steps below.
  1. Step 1: Install Latest Azure Tools.
  2. Step 2: Get Azure Publish Settings File.
  3. Step 3: Import publish settings file.
  4. Step 4: Set default Azure Subscription.

How do I connect to MsolService?

Connect to Azure via MSOL (MSOnline)
  1. # Install the MSOnline module if this is first use.
  2. Install-Module MSOnline.
  3. # Add the MSOnline module to the PowerShell session.
  4. Import-Module MSOnline.
  5. # Get credentials of Azure admin.
  6. $Credentials = Get-Credential.
  7. # Connect to Azure AD.
  8. Connect-MsolService -Credential $Credentials.

What is context in PowerShell?

Azure contexts are PowerShell objects representing your active subscription to run commands against, and the authentication information needed to connect to an Azure cloud.

How do I install an azure PowerShell module?

To use Azure PowerShell in PowerShell 5.1 on Windows:
  1. Update to Windows PowerShell 5.1. If you're on Windows 10 version 1607 or higher, you already have PowerShell 5.1 installed.
  2. Install . NET Framework 4.7.
  3. Make sure you have the latest version of PowerShellGet. Run Install-Module -Name PowerShellGet -Force .

How do I determine PowerShell version?

To check the PowerShell version installed in your system, you can use either $PSVersionTable or $host command.

How do I find my Azure subscription ID?

Log in to the Microsoft Azure Portal. In the left navigation bar, select the “Subscriptions” menu item to obtain a list of all the subscriptions associated with your Microsoft Azure account. The list includes the subscription ID for each subscription.

How do I install an AZ module in PowerShell?

If you are using Azure Cloud Shell, the Az module is now installed by default. To install the Az module with global scope, run the Install-Module cmdlet as shown below in an elevated PowerShell window. Once the Az module is installed, you can connect to your Azure subscription using the Connect-AzAccount cmdlet.

Which of the following are classic Azure roles?

Account Administrator, Service Administrator, and Co-Administrator are the three classic subscription administrator roles in Azure.

How do I check my current Azure CLI subscription?

You can run : az account list -o table . The output will be a list of resources in table form. The details of your current subscription will be on line with IsDefault = True .

How do I change the default directory in Azure portal?

How to change the default AAD. The Azure portal shows the default directory of Azure subscriptions on the "settings" / "subscriptions" as mentioned above. The way is very simple: Select the Azure subscription and click "Edit directory" in the menu below. Now choose the new desired AAD from the Directory dropdown.

What is an Azure subscription?

An Azure subscription is a logical container used to provision resources in Azure. It holds the details of all your resources like virtual machines (VMs), databases, and more. As you use the VM, the usage of the VM is aggregated and billed monthly.

What type of syntax is used with azure arm templates?

Declarative syntax: ARM templates allow you to create and deploy an entire Azure infrastructure declaratively. For example, you can deploy not only virtual machines, but also the network infrastructure, storage systems and any other resources you may need.

How do I log into Azure Command Line?

Sign in interactively

Run the login command. If the CLI can open your default browser, it will do so and load an Azure sign-in page. Otherwise, open a browser page at and enter the authorization code displayed in your terminal.

Which feature is provided only with Microsoft Azure Active Directory Premium p2?

The premium P2 version of the Azure Active directory has additional features of Identity Protection and Identity governance. Identity protection covers features such as - Vulnerabilities and risky account detection, Risk events investigation and Risk-based conditional access policies.

How do I rename my Azure App Service?

Answer is No, you can not rename the app service plan once it is created. Alternatively, you can create a new app service plan in the same region and same resource group where your web app exists and then remap your web app to a new app service plan and delete the old one.

How do I change my account information?

Change personal info
  1. On your Android phone or tablet, open your device's Settings app .
  2. Tap Google. Manage your Google Account.
  3. At the top, tap Personal info.
  4. Under "Profile" or "Contact info," tap the info you want to change.
  5. Make your changes.

How do I change my Microsoft account name?

Here's how to change your display name if you're signed in to your Microsoft account:
  1. Sign in to the Your info page on the Microsoft account website.
  2. Under your name, select Edit name. If there's no name listed yet, select Add name.
  3. Enter the name you want, then type the CAPTCHA and select Save.

How do I change my Azure subscription to pay as you go?

Switch subscription offer
  1. Sign in at Azure Account Center.
  2. Select your individual subscription with pay-as-you-go rates.
  3. Click Switch to another offer.
  4. Select the offer you want from the list of offers your subscription can be switched to.

How do I change the owner of Azure account?

Process for changing the account administrator
  1. Log on to the Enterprise Portal as the enterprise administrator.
  2. Select Manage > Account, and then select the account owner for the subscriptions that you want to transfer.
  3. Click on “Transfer subscription.”
  4. Select the target subscription and click through to the next step.

How do I change my Microsoft account information?

To update your name or your business's name:
  1. Sign in to your Microsoft account. Note: If you see a screen asking you which account you want to use, it means you have two Microsoft accounts associated with the same email address.
  2. Select Your info.
  3. Select Edit name, make your preferred changes, and then select Save.

How do I change my azure region?

To change your organization region, use Azure DevOps Virtual Support Agent, and then select the quick action, Change Organization Region. If you don't see a direct link, select from the Chat Menu.