How it works...

After you install the Azure cmdlets, the first thing to do is logon to Azure. If you are using an AAD account to logon, you can pass credentials directly the cmdlet. If you are using a Microsoft Live account to logon, you see two dialog boxes:

From this dialog, you enter your Live ID and click on Sign in. Azure takes you to a second dialog box where you enter your password:

After a successful logon in step 1, the cmdlet outputs details about your account, like this:

In step 2, you obtain (and display) the subscription object ...

Get Windows Server 2016 Automation with PowerShell Cookbook - Second Edition now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.