Login to Azure



Classic (Service Management) mode:

Add-AzureAccount
click below button to copy the code. By azure tutorial team
  • This will authenticate you using Azure Active Directory, and PowerShell gets an access token that expires after about 12 hours. So you must repeat the authentication after 12 hours.
  • An alternative is to run the following cmdlet:
Get-AzurePublishSettingsFile
click below button to copy the code. By azure tutorial team
  • This opens a browser window where you can download a publish settings file. This file contains a certificate that allows PowerShell to authenticate. Then you can import your publish settings file using the following:
Import-AzurePublishSettingsFile
click below button to copy the code. By azure tutorial team
  • Remember that the publish settings file contains a certificate with effectively admin privileges in your subscription. Keep it secure or delete it after using it.

Resource manager

  • In Resource Manager side, we can only use Azure Active Directory authentication with the 12 hour access tokens. There are two alternative commands currently that you can use:
Login-AzureRmAccount
Add-AzureRmAccount
click below button to copy the code. By azure tutorial team

Related Searches to Login to Azure