This post is sort of a follow up on a previous post where I attempted to prevent a duplicate login when accessing both Azure Resource Manager and Azure AD in the same PowerShell script, still without success by the way. But I can use something I learned there to accomplish something else: getting an access token for working with the Azure REST API.
Getting the access token
Getting the access token follows the same steps as described in my earlier post:
Of course, you have to login using an account that has sufficient permissions to access the REST API.