You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Now use the access token to authenticate to key vault and read a secret. Be sure to substitute the name of your key vault in the URL (*https:\//mykeyvault.vault.azure.net/...*):
The response looks similar to the following, showing the secret. In your code, you would parse this output to obtain the secret. Then, use the secret in a subsequent operation to access another Azure resource.
@@ -205,14 +205,14 @@ The `--assign-identity` parameter with no additional value enables a system-assi
205
205
206
206
```azurecli-interactive
207
207
# Get the resource ID of the resource group
208
-
rgID=$(az group show --name myResourceGroup --query id --output tsv)
208
+
RG_ID=$(az group show --name myResourceGroup --query id --output tsv)
209
209
210
210
# Create container group with system-managed identity
211
211
az container create \
212
212
--resource-group myResourceGroup \
213
213
--name mycontainer \
214
214
--image mcr.microsoft.com/azure-cli \
215
-
--assign-identity --scope $rgID \
215
+
--assign-identity --scope $RG_ID \
216
216
--command-line "tail -f /dev/null"
217
217
```
218
218
@@ -240,7 +240,7 @@ The `identity` section in the output looks similar to the following, showing tha
240
240
Set a variable to the value of `principalId` (the service principal ID) of the identity, to use in later steps.
241
241
242
242
```azurecli-interactive
243
-
spID=$(az container show \
243
+
SP_ID=$(az container show \
244
244
--resource-group myResourceGroup \
245
245
--name mycontainer \
246
246
--query identity.principalId --out tsv)
@@ -254,7 +254,7 @@ Run the following [az keyvault set-policy](/cli/azure/keyvault) command to set a
0 commit comments