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
Copy file name to clipboardExpand all lines: sdk/identity/identity/README.md
+12-4Lines changed: 12 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -37,7 +37,7 @@ To authenticate in Visual Studio Code, first ensure the [Azure Account Extension
37
37
38
38
Applications using the `AzureCliCredential`, rather directly or via the `DefaultAzureCredential`, can use the Azure CLI account to authenticate calls in the application when running locally.
39
39
40
-
To authenticate with the [Azure CLI][azure_cli] users can run the command `az login`. For users running on a system with a default web browser the azure cli will launch the browser to authenticate the user.
40
+
To authenticate with the [Azure CLI][azure_cli] users can run the command `az login`. For users running on a system with a default web browser the Azure cli will launch the browser to authenticate the user.
41
41
42
42
![Azure CLI Account Sign In][azureclilogin_image]
43
43
@@ -107,24 +107,32 @@ This example demonstrates authenticating the `KeyClient` from the [@azure/keyvau
107
107
```javascript
108
108
// The default credential first checks environment variables for configuration as described above.
109
109
// If environment configuration is incomplete, it will try managed identity.
// Azure SDK clients accept the credential as a parameter
114
118
constcredential=newDefaultAzureCredential();
119
+
120
+
// Create authenticated client
115
121
constclient=newKeyClient(vaultUrl, credential);
122
+
123
+
// Use service from authenticated client
116
124
constgetResult=awaitclient.getKey("MyKeyName");
117
125
```
118
126
119
127
### Specifying a user assigned managed identity with the `DefaultAzureCredential`
120
128
121
-
Many Azure hosts allow the assignment of a user assigned managed identity. This example demonstrates configuring the `DefaultAzureCredential` to authenticate a user assigned identity when deployed to an azure host. It then authenticates a `KeyClient` from the [@azure/keyvault-keys](https://www.npmjs.com/package/@azure/keyvault-keys) client library with credential.
129
+
Many Azure hosts allow the assignment of a user assigned managed identity. This example demonstrates configuring the `DefaultAzureCredential` to authenticate a user assigned identity when deployed to an Azure host. It then authenticates a `KeyClient` from the [@azure/keyvault-keys](https://www.npmjs.com/package/@azure/keyvault-keys) client library with credential.
0 commit comments