Connecting to Azure subscription using Azure Active Directory credential is a fairly simple process. One drawback, however is that you need to enter your credentials each time you start a new Azure PowerShell session, or every 12 hours if the session is kept open.
Note :{ To automate data center operations, entering credentials for each session might not be ideal. Therefore, consider using a publish settings file, as outlined in the next section, Connecting to Azure using a publish settings file,or consider using a management certificate (http://msdn.microsoft.com/en-us/library/azure/gg551722.aspx).}
Use the following steps to connect to Microsoft Azure using Azure Active Directory credentials:
1. Open Microsoft Azure PowerShell from the Start menu.
2. Use the Add-AzureAccount cmdlet by entering it in the Command Prompt and pressing Enter, as shown here:
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj7dWA7IKSRqfoGmEyA9EzGBnf2dEYoRZfIEIUU-HlUEFkrzutp4erg90VnB2H1018QAlbwI0xYAKKkCv4yt8dTa8pnOhrmYDat4n0pL8HjxqP1RcPsbVWQa7N63hn1HpXlE7xL9MmEOtdn/s640/2.JPG)
3. When prompted, enter the e-mail address for the account used to manage Microsoft Azure and select Continue (the Microsoft account, using your e-mail address, used when creating an Azure subscription is automatically added to an instance of Azure Active Directory):
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhYvkfi4SX4AFpMUwWoST82TkQ00aNm_9LQEaUgIaLloXML7Y57vHQkj6a_nzD3j57BN2Oplkbzr2bwQzwCtW0XPg0mWe7TwIz02iproERGshoOJhVTo6Jt0UkRsF3zxPS7ucd-7veSIoii/s640/3.JPG)
4. Enter the password for your account and select Sign in.
5. Once the sign-in is complete, the Command Prompt will indicate that the account has been added and will indicate which subscription has been selected, as shown here:
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiFsurNZR8TVFpFMMD6unJiV2yGN3H1ggk6ejQ1itYAqQpTuYTI3FCp9S_NQhbuHeU6x7m4FsOu1UT2m_bxxiafcfuxuZfC_xp74Uo40kI4VFmvL8hdYd0za9neh1FF3_2b57EcqgAjgSTt/s640/4.JPG)
Note :: { If you have multiple Microsoft Azure subscriptions that you manage with the same Microsoft account, you can use the Select-AzureSubscription cmdlet to switch between subscriptions in the PowerShell session.}
Note :{ To automate data center operations, entering credentials for each session might not be ideal. Therefore, consider using a publish settings file, as outlined in the next section, Connecting to Azure using a publish settings file,or consider using a management certificate (http://msdn.microsoft.com/en-us/library/azure/gg551722.aspx).}
Use the following steps to connect to Microsoft Azure using Azure Active Directory credentials:
1. Open Microsoft Azure PowerShell from the Start menu.
2. Use the Add-AzureAccount cmdlet by entering it in the Command Prompt and pressing Enter, as shown here:
3. When prompted, enter the e-mail address for the account used to manage Microsoft Azure and select Continue (the Microsoft account, using your e-mail address, used when creating an Azure subscription is automatically added to an instance of Azure Active Directory):
4. Enter the password for your account and select Sign in.
5. Once the sign-in is complete, the Command Prompt will indicate that the account has been added and will indicate which subscription has been selected, as shown here:
Note :: { If you have multiple Microsoft Azure subscriptions that you manage with the same Microsoft account, you can use the Select-AzureSubscription cmdlet to switch between subscriptions in the PowerShell session.}