skip to content
Alvin Lucillo

Generate token for azure management apis

/ 1 min read

You can generate an access token for querying azure management apis. For example, you can use the token for the header --header "Authorization: Bearer <access-token>". Note that the token below is fictitious.

az account get-access-token \
    --resource https://management.azure.com \
    --query accessToken \
    --output tsv
eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJhdWQiOiJodHRwczovL21hbmFnZW1lbnQuYXp1cmUuY29tLyIsImlzcyI6Imh0dHBzOi8vc3RzLndpbmRvd3MubmV0LzAwMDAwMDAwLTAwMDAtMDAwMC0wMDAwLTAwMDAwMDAwMDAwMC8iLCJzdWIiOiIwMDAwMDAwMC0wMDAwLTAwMDAtMDAwMC0wMDAwMDAwMDAwMDAiLCJleHAiOjAsImRlbW8iOnRydWV9.ZGVtby1zaWduYXR1cmUtbm90LXZhbGlk