Skip to content

Commit c6e4b22

Browse files
Updated-SP_PASSWD
1 parent 029945b commit c6e4b22

File tree

1 file changed

+5
-1
lines changed
  • 18-Azure-Container-Registry-ACR/18-02-ACR-not-attached-to-AKS-Schedule-to-NodePools

1 file changed

+5
-1
lines changed

18-Azure-Container-Registry-ACR/18-02-ACR-not-attached-to-AKS-Schedule-to-NodePools/README.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,14 +126,18 @@ SERVICE_PRINCIPAL_NAME=acr-sp-demo
126126
# Obtain the full registry ID for subsequent command args
127127
ACR_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

138142
SP_APP_ID=$(az ad sp list --display-name $SERVICE_PRINCIPAL_NAME --query [].appId --output tsv)
139143

0 commit comments

Comments
 (0)