Skip to content

Commit 57c1fdf

Browse files
authored
Merge pull request #76363 from dduportal/patch-1
Add double quotes around `$SP_*` variables
2 parents 7fd56c7 + 683c524 commit 57c1fdf

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

articles/aks/update-credentials.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ To check the expiration date of your service principal, use the [az ad sp creden
3737
```azurecli
3838
SP_ID=$(az aks show --resource-group myResourceGroup --name myAKSCluster \
3939
--query servicePrincipalProfile.clientId -o tsv)
40-
az ad sp credential list --id $SP_ID --query "[].endDate" -o tsv
40+
az ad sp credential list --id "$SP_ID" --query "[].endDate" -o tsv
4141
```
4242

4343
### Reset the existing service principal credential
@@ -55,7 +55,7 @@ SP_ID=$(az aks show --resource-group myResourceGroup --name myAKSCluster \
5555
With a variable set that contains the service principal ID, now reset the credentials using [az ad sp credential reset][az-ad-sp-credential-reset]. The following example lets the Azure platform generate a new secure secret for the service principal. This new secure secret is also stored as a variable.
5656

5757
```azurecli-interactive
58-
SP_SECRET=$(az ad sp credential reset --name $SP_ID --query password -o tsv)
58+
SP_SECRET=$(az ad sp credential reset --name "$SP_ID" --query password -o tsv)
5959
```
6060

6161
Now continue on to [update AKS cluster with new service principal credentials](#update-aks-cluster-with-new-service-principal-credentials). This step is necessary for the Service Principal changes to reflect on the AKS cluster.
@@ -102,8 +102,8 @@ az aks update-credentials \
102102
--resource-group myResourceGroup \
103103
--name myAKSCluster \
104104
--reset-service-principal \
105-
--service-principal $SP_ID \
106-
--client-secret $SP_SECRET
105+
--service-principal "$SP_ID" \
106+
--client-secret "$SP_SECRET"
107107
```
108108

109109
For small and midsize clusters, it takes a few moments for the service principal credentials to be updated in the AKS.

0 commit comments

Comments
 (0)