Guest Chris_Ayers Posted June 5 Posted June 5 [HEADING=1]Introduction[/HEADING] If you have multiple Azure subscriptions, you might have experienced the frustration of logging into the wrong one with the az login command. This can cause errors and confusion when you try to run commands or access resources in the wrong subscription. Fortunately, there is a new login experience that makes it easier to select the right subscription. This feature was announced at the Build 2024 conference and is available in version v2.61.0 of the Azure CLI. old az login experience [HEADING=1]How to use the new az login experience[/HEADING] To use the new login experience, you need to update your Azure CLI to the latest version. There are a few ways to do this as documented here: How to update the Azure CLI. You can manually do this by running the command: az upgrade Once you have the latest version, you can run the az login command as usual. However, instead of logging into the default subscription, you will see a list of your available subscriptions and a prompt to choose one. For example: new az login experience You can hit enter and log into the default or enter the number of the subscription you want to log into. The subscription you choose will be set as the default for the current session. You can verify this by running the command: az account show If you want to switch to a different subscription, you can run the az login command again and choose another one. You can also use the az account set command with the subscription ID or name. [HEADING=1]Benefits of the new az login experience[/HEADING] The new login experience has several benefits for Azure users who have multiple subscriptions: Reduces Errors and Confusion: Minimizes the risk of logging into the wrong subscription. Saves Time and Effort: Avoids the need to run additional commands to set or change the default subscription. Improves User Experience: Provides an interactive and intuitive way to choose the subscription. The new login experience for Azure subscriptions with az login is a welcome feature that makes it easier to work with multiple subscriptions. For more information, visit Sign in with Azure CLI at a command line | Microsoft Learn Continue reading... Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.