Connect to Azure with PowerShell - Connect-AzAccount

Published: 21 February 2023
on channel: Mike in the Cloud
12,258
134

To connect to Azure using PowerShell, you can follow these steps:

Install the Azure PowerShell module. You can do this by running the following command in an elevated PowerShell session:


Install-Module -Name Az -AllowClobber
Once the module is installed, you can connect to your Azure account by running the following command:


Connect-AzAccount
This will open a pop-up window asking you to sign in to your Azure account. Once you have signed in, you will be connected to your Azure account.

If you have multiple Azure subscriptions, you can select the one you want to work with by running the following command:


Set-AzContext -SubscriptionId 'subscription-id'
Replace 'subscription-id' with the ID of the subscription you want to use.

That's it! You are now connected to Azure using PowerShell. You can start using the cmdlets provided by the Az module to manage your Azure resources.


Watch video Connect to Azure with PowerShell - Connect-AzAccount online without registration, duration hours minute second in high quality. This video was added by user Mike in the Cloud 21 February 2023, don't forget to share it with your friends and acquaintances, it has been viewed on our site 12,258 once and liked it 134 people.