Connect to Azure Rest API via CURL
As a user: curl -sL https://aka.ms/InstallAzureCLIDeb | sudo bash apt install -y jq az login az account get-access-token declare subid=”xxx” declare response=$(az account get-access-token) declare token=$(echo $response | jq “.accessToken” -r) curl -i -X GET -H “x-ms-version: 2018-11-09” -H “content-length: 0” -H “Authorization: Bearer $token” “https://management.azure.com/subscriptions/xxx/resourceGroups/nvx-demo-sec/providers/Microsoft.Compute/virtualMachines?api-version=2021-07-01” As a application: declare TENANT_NAME=”xxx” # Values for the […]