Skip to content

Commit 82f60c0

Browse files
authored
Merge pull request #107942 from lanicolas/patch-26
Align with bash design guidelines
2 parents d763525 + 61a0912 commit 82f60c0

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

articles/mysql/single-server/how-to-connect-with-managed-identity.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -49,24 +49,24 @@ To configure the identity in the following steps, use the [az identity show](/cl
4949
```azurecli
5050
# Get resource ID of the user-assigned identity
5151
52-
resourceID=$(az identity show --resource-group myResourceGroup --name myManagedIdentity --query id --output tsv)
52+
RESOURCE_ID=$(az identity show --resource-group myResourceGroup --name myManagedIdentity --query id --output tsv)
5353
5454
# Get client ID of the user-assigned identity
5555
5656
57-
clientID=$(az identity show --resource-group myResourceGroup --name myManagedIdentity --query clientId --output tsv)
57+
CLIENT_ID=$(az identity show --resource-group myResourceGroup --name myManagedIdentity --query clientId --output tsv)
5858
```
5959

6060
We can now assign the user-assigned identity to the VM with the [az vm identity assign](/cli/azure/vm/identity#az-vm-identity-assign) command:
6161

6262
```azurecli
63-
az vm identity assign --resource-group myResourceGroup --name myVM --identities $resourceID
63+
az vm identity assign --resource-group myResourceGroup --name myVM --identities $RESOURCE_ID
6464
```
6565

6666
To finish setup, show the value of the Client ID, which you'll need in the next few steps:
6767

6868
```bash
69-
echo $clientID
69+
echo $CLIENT_ID
7070
```
7171

7272
## Creating a MySQL user for your Managed Identity
@@ -98,7 +98,7 @@ For testing purposes, you can run the following commands in your shell. Note you
9898
# Retrieve the access token
9999

100100

101-
accessToken=$(curl -s 'http://169.254.169.254/metadata/identity/oauth2/token?api-version=2018-02-01&resource=https%3A%2F%2Fossrdbms-aad.database.windows.net&client_id=CLIENT_ID' -H Metadata:true | jq -r .access_token)
101+
ACCESS_TOKEN=$(curl -s 'http://169.254.169.254/metadata/identity/oauth2/token?api-version=2018-02-01&resource=https%3A%2F%2Fossrdbms-aad.database.windows.net&client_id=CLIENT_ID' -H Metadata:true | jq -r .access_token)
102102

103103
# Connect to the database
104104

0 commit comments

Comments
 (0)