Last active
August 10, 2021 15:12
-
-
Save markscottwright/6b55d9b01d5769e9a7924dfaca40b4b5 to your computer and use it in GitHub Desktop.
How to get an Azure Managed Identity token using curl
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
token=`curl -s 'http://169.254.169.254/metadata/identity/oauth2/token?api-version=2018-02-01&resource=https%3A%2F%2Fstorage.azure.com' -H Metadata:true | grep -o 'access.token[": ]\+[^"]\+' | sed s/access_token...//` |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment