How to get Azure REST APIs access tokens using PowerShell — Update (November 26, 2020)
Nov 26, 2020
Since the release of Az module version 5.x, cmdlet Get-AzContext doesn’t populate TokenCache property anymore. New cmdlet Get-AzAccessToken, avalable starting Az v 5.1.0, can be used now to acquire access tokens:
$kvAccessToken = (Get-AzAccessToken -ResourceUrl 'https://vault.azure.net').Token