Skip to content

Commit dbee40c

Browse files
authored
Merge pull request #108075 from lanicolas/patch-38
Aligned bash style guide
2 parents 0dfecd1 + 20ce2aa commit dbee40c

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

articles/container-instances/using-azure-container-registry-mi.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -45,15 +45,15 @@ In order to properly configure the identity in future steps, use [az identity sh
4545

4646
```azurecli-interactive
4747
# Get resource ID of the user-assigned identity
48-
userID=$(az identity show --resource-group myResourceGroup --name myACRId --query id --output tsv)
48+
USERID=$(az identity show --resource-group myResourceGroup --name myACRId --query id --output tsv)
4949
# Get service principal ID of the user-assigned identity
50-
spID=$(az identity show --resource-group myResourceGroup --name myACRId --query principalId --output tsv)
50+
SPID=$(az identity show --resource-group myResourceGroup --name myACRId --query principalId --output tsv)
5151
```
5252

5353
You'll need the identity's resource ID to sign in to the CLI from your virtual machine. To show the value:
5454

5555
```bash
56-
echo $userID
56+
echo $USERID
5757
```
5858

5959
The resource ID is of the form:
@@ -65,7 +65,7 @@ The resource ID is of the form:
6565
You'll also need the service principal ID to grant the managed identity access to your container registry. To show the value:
6666

6767
```bash
68-
echo $spID
68+
echo $SPID
6969
```
7070

7171
The service principal ID is of the form:
@@ -79,7 +79,7 @@ xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxxx
7979
In order for your identity to access your container registry, you must grant it a role assignment. Use to following command to grant the `acrpull` role to the identity you've just created, making sure to provide your registry's ID and the service principal we obtained earlier:
8080

8181
```azurecli-interactive
82-
az role assignment create --assignee $spID --scope <registry-id> --role acrpull
82+
az role assignment create --assignee $SPID --scope <registry-id> --role acrpull
8383
```
8484

8585
## Deploy using an Azure Resource Manager (ARM) template
@@ -161,15 +161,15 @@ az deployment group create --resource-group myResourceGroup --template-file azur
161161
To deploy a container group using managed identity to authenticate image pulls via the Azure CLI, use the following command, making sure that your `<dns-label>` is globally unique:
162162

163163
```azurecli-interactive
164-
az container create --name my-containergroup --resource-group myResourceGroup --image <loginServer>/hello-world:v1 --acr-identity $userID --assign-identity $userID --ports 80 --dns-name-label <dns-label>
164+
az container create --name my-containergroup --resource-group myResourceGroup --image <loginServer>/hello-world:v1 --acr-identity $USERID --assign-identity $USERID --ports 80 --dns-name-label <dns-label>
165165
```
166166

167167
## Deploy in a virtual network using the Azure CLI
168168

169169
To deploy a container group to a virtual network using managed identity to authenticate image pulls from an ACR that runs behind a private endpoint via the Azure CLI, use the following command:
170170

171171
```azurecli-interactive
172-
az container create --name my-containergroup --resource-group myResourceGroup --image <loginServer>/hello-world:v1 --acr-identity $userID --assign-identity $userID --vnet "/subscriptions/$SUBSCRIPTION_ID/resourceGroups/"/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxxx/resourceGroups/myVNetResourceGroup/providers/ --subnet mySubnetName
172+
az container create --name my-containergroup --resource-group myResourceGroup --image <loginServer>/hello-world:v1 --acr-identity $USERID --assign-identity $USERID --vnet "/subscriptions/$SUBSCRIPTION_ID/resourceGroups/"/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxxx/resourceGroups/myVNetResourceGroup/providers/ --subnet mySubnetName
173173
```
174174

175175
For more info on how to deploy to a virtual network see [Deploy container instances into an Azure virtual network](./container-instances-vnet.md).

0 commit comments

Comments
 (0)