Created
November 9, 2022 18:59
-
-
Save omarmciver/06c4dd83a14ce04e3c9b23c8be7aa14b to your computer and use it in GitHub Desktop.
AZ API Calls
This file contains 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
$ SUBSCRIPTION_ID=$(az account show --query id -o tsv) | |
$ az rest \ | |
--url "https://management.azure.com/subscriptions/$SUBSCRIPTION_ID/resourcegroups?api-version=2020-06-01 | | |
jq ".value | .[] | .name" -r | |
OR | |
$ curl -sL \ | |
-H "authorization: bearer $(az account get-access-token --query accessToken -o tsv)" \ | |
-H "contenttype: application/json" \ | |
"https://management.azure.com/subscriptions/$SUBSCRIPTION_ID/resourcegroups?api-version=2020-06-01" | | |
jq ".value | .[] | .name" -r |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment