Advertisement
Guest User

Untitled

a guest
Nov 15th, 2019
122
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.45 KB | None | 0 0
  1. ACR_NAME=acramdemo
  2. SERVICE_PRINCIPAL_NAME=acr-service-principal
  3. ACR_REGISTRY_ID=$(az acr show --name $ACR_NAME --query id --output tsv)
  4. SP_PASSWD=$(az ad sp create-for-rbac --name http://$SERVICE_PRINCIPAL_NAME --scopes $ACR_REGISTRY_ID --role acrpull --query password --output tsv)
  5. SP_APP_ID=$(az ad sp show --id http://$SERVICE_PRINCIPAL_NAME --query appId --output tsv)
  6. echo "Service principal ID: $SP_APP_ID"
  7. echo "Service principal password: $SP_PASSWD"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement