Created
August 30, 2018 01:30
-
-
Save asears/b10e4ee07b9a3f54ab62acef20c5efbf to your computer and use it in GitHub Desktop.
Get Azure Cloud Shell Access Token
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
| #!/bin/sh | |
| response=$(curl http://localhost:50342/oauth2/token --data "resource=https://management.azure.com/" -H Metadata:true -s) | |
| access_token=$(echo $response | python -c 'import sys, json; print (json.load(sys.stdin)["access_token"])') | |
| echo The MSI access token is $access_token |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment