Skip to content

Commit fd95eb2

Browse files
Merge pull request #108082 from lanicolas/patch-41
Align with bash style guide
2 parents 497c37f + a1a1299 commit fd95eb2

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

articles/cloud-shell/msi-authorization.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,12 @@ If you want to authenticate with different credentials, you can do so using `az
3030
### Acquire token
3131

3232
Execute the following commands to set your user access token as an environment variable,
33-
`access_token`.
33+
`ACCESS_TOKEN`.
3434

3535
```bash
36-
response=$(curl http://localhost:50342/oauth2/token --data "resource=https://management.azure.com/" -H Metadata:true -s)
37-
access_token=$(echo $response | python -c 'import sys, json; print (json.load(sys.stdin)["access_token"])')
38-
echo The access token is $access_token
36+
RESPONSE=$(curl http://localhost:50342/oauth2/token --data "resource=https://management.azure.com/" -H Metadata:true -s)
37+
ACCESS_TOKEN=$(echo $response | python -c 'import sys, json; print (json.load(sys.stdin)["access_token"])')
38+
echo The access token is $ACCESS_TOKEN
3939
```
4040

4141
### Use token
@@ -44,7 +44,7 @@ Execute the following command to get a list of all Virtual Machines in your acco
4444
you acquired in the previous step.
4545

4646
```bash
47-
curl https://management.azure.com/subscriptions/{subscriptionId}/providers/Microsoft.Compute/virtualMachines?api-version=2021-07-01 -H "Authorization: Bearer $access_token" -H "x-ms-version: 2019-02-02"
47+
curl https://management.azure.com/subscriptions/{subscriptionId}/providers/Microsoft.Compute/virtualMachines?api-version=2021-07-01 -H "Authorization: Bearer $ACCESS_TOKEN" -H "x-ms-version: 2019-02-02"
4848
```
4949

5050
## Handling token expiration

0 commit comments

Comments
 (0)