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 the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.