$AAD_TENANT_ID="" $CLIENT_APP_ID="" $CLIENT_APP_SECRET="" $SC_APP_ID="" $ACCESS_TOKEN=$(curl -s --location --request POST "https://login.microsoftonline.com/$AAD_TENANT_ID/oauth2/token" ` --header 'Content-Type: application/x-www-form-urlencoded' ` --data-urlencode 'grant_type=client_credentials' ` --data-urlencode "client_id=$CLIENT_APP_ID" ` --data-urlencode "client_secret=$CLIENT_APP_SECRET" ` --data-urlencode "resource=$SC_APP_ID" | jq -r '.access_token' ) if ($?) { echo "Access token acquired: $ACCESS_TOKEN" $RESULT=$(curl -s --location --request GET "https:///sc/api/solutions" ` --header "Authorization: Bearer $ACCESS_TOKEN" ` --header 'Content-Type: application/json') echo "$RESULT" } else { echo "Failed to acquire access token" }