Skip to content

Commit 2aa4238

Browse files
authored
Merge pull request #123404 from sanray-ms/patch-4
Update container-instances-managed-identity.md
2 parents 756d7c1 + bbbbb1c commit 2aa4238

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

articles/container-instances/container-instances-managed-identity.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,12 @@ Output:
176176
{"access_token":"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx1QiLCJhbGciOiJSUzI1NiIsIng1dCI6Imk2bEdrM0ZaenhSY1ViMkMzbkVRN3N5SEpsWSIsImtpZCI6Imk2bEdrM0ZaenhSY1ViMkMzbkVRN3N5SEpsWSJ9......xxxxxxxxxxxxxxxxx","refresh_token":"","expires_in":"28799","expires_on":"1539927532","not_before":"1539898432","resource":"https://vault.azure.net/","token_type":"Bearer"}
177177
```
178178

179+
For Windows containers, metadata server (169.254.169.254) is not available. Run the following or equivalent commands to get an access token.
180+
181+
```console
182+
curl -G -v %IDENTITY_ENDPOINT% --data-urlencode resource=https://vault.azure.net --data-urlencode principalId=<principal id> -H secret:%IDENTITY_HEADER%
183+
```
184+
179185
To store the access token in a variable to use in subsequent commands to authenticate, run the following command:
180186

181187
```bash
@@ -289,6 +295,8 @@ The value of the secret is retrieved:
289295
"Hello Container Instances"
290296
```
291297

298+
For Windows containers, the 'az login' command will not work because the metadata server is unavailable. Additionally, a managed identity token cannot be generated in a Windows VNet container.
299+
292300
## Enable managed identity using Resource Manager template
293301

294302
To enable a managed identity in a container group using a [Resource Manager template](container-instances-multi-container-group.md), set the `identity` property of the `Microsoft.ContainerInstance/containerGroups` object with a `ContainerGroupIdentity` object. The following snippets show the `identity` property configured for different scenarios. See the [Resource Manager template reference](/azure/templates/microsoft.containerinstance/containergroups). Specify a minimum `apiVersion` of `2018-10-01`.

0 commit comments

Comments
 (0)