File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed
18-Azure-Container-Registry-ACR/18-02-ACR-not-attached-to-AKS-Schedule-to-NodePools Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -126,14 +126,18 @@ SERVICE_PRINCIPAL_NAME=acr-sp-demo
126126# Obtain the full registry ID for subsequent command args
127127ACR_REGISTRY_ID=$( az acr show --name $ACR_NAME --query id --output tsv)
128128
129+ # Get subscription ID
130+ SUBSCRIPTION_ID=$( az account show --query id -o tsv)
131+
132+
129133# Create the service principal with rights scoped to the registry.
130134# Default permissions are for docker pull access. Modify the '--role'
131135# argument value as desired:
132136# acrpull: pull only
133137# acrpush: push and pull
134138# owner: push, pull, and assign roles
135139# # IMPORTANT NOTE: REPLACE SUBSCRIPTION_ID with your subscription ID
136- SP_PASSWD=$( az ad sp create-for-rbac --name $SERVICE_PRINCIPAL_NAME --scopes $ACR_REGISTRY_ID --scope subscriptions/<< SUBSCRIPTION_ID>> --role acrpull --query "password" --output tsv)
140+ SP_PASSWD=$( az ad sp create-for-rbac --name $SERVICE_PRINCIPAL_NAME --scopes $ACR_REGISTRY_ID --scope subscriptions/$ SUBSCRIPTION_ID --role acrpull --query " password" --output tsv)
137141
138142SP_APP_ID=$( az ad sp list --display-name $SERVICE_PRINCIPAL_NAME --query [].appId --output tsv)
139143
You can’t perform that action at this time.
0 commit comments