I am trying to setup azure privatelink on several snowflake accounts and I am terraforming all of the steps like creating the private endpoints and authorizing the connection from snowflake side (I am following this tutorial).
In the docs they are using command: az account get-access-token --subscription <SubscriptionID>
and than you copy the accessToken and this works for the authorization, but my problem is that I am running all of this in a CI/CD and I don't have az installed so the only way to get this token is with a bash script. I've tried using azure RestAPI:
TOKEN="$(curl -s -X POST \
-H "Accept: application/json" \
-d "subscription_id=${SUBSCRIPTION_ID}"\
-d "client_id=${CLIENT_ID}" \
-d "client_secret=${CLIENT_SECRET}" \
-d "grant_type=client_credentials" \
-d "resource=https://ossrdbms-aad.database.windows.net" \
"https://login.microsoftonline.com/${TENANT_ID}/oauth2/token" \
| jq -r .access_token)"
but this apparently gives a different access token (for azure ad) that is not working for the snowflake authorization.
Is there any Azure RestAPI command (similar to this curl command above) that gives the same output like: az account get-access-token --subscription <SubscriptionID>
so I can use it in my script?