Skip to content

Commit

Permalink
Azure Identity README cleanup (#45866)
Browse files Browse the repository at this point in the history
  • Loading branch information
scottaddie authored Sep 9, 2024
1 parent ade2cee commit a315ab8
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions sdk/identity/Azure.Identity/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -160,9 +160,9 @@ These examples demonstrate authenticating `SecretClient` from the [Azure.Securit

#### Authenticate with a user-assigned managed identity

To authenticate with a user-assigned managed identity, you must specify an ID for the managed identity.
To authenticate with a user-assigned managed identity, you must specify one of the following IDs for the managed identity.

The following example demonstrates authenticating with a user-assigned managed identity using the client ID:
**Client ID**

```C# Snippet:AuthenticatingWithManagedIdentityCredentialUserAssigned
string userAssignedClientId = "some client ID";
Expand All @@ -172,7 +172,7 @@ var credential = new ManagedIdentityCredential(
var client = new SecretClient(new Uri("https://myvault.vault.azure.net/"), credential);
```

The following example demonstrates authenticating with a user-assigned managed identity using its resource ID:
**Resource ID**

```C# Snippet:AuthenticatingWithManagedIdentityCredentialUserAssignedResourceId
ResourceIdentifier userAssignedResourceId = new ResourceIdentifier(
Expand All @@ -183,7 +183,7 @@ var credential = new ManagedIdentityCredential(
var client = new SecretClient(new Uri("https://myvault.vault.azure.net/"), credential);
```

The following example demonstrates authenticating with a user-assigned managed identity using its object ID:
**Object ID**

```C# Snippet:AuthenticatingWithManagedIdentityCredentialUserAssignedObjectId
string userAssignedObjectId = "some object ID";
Expand Down Expand Up @@ -214,7 +214,7 @@ var credential = new DefaultAzureCredential(
});
```

[AzureAuthorityHosts](https://learn.microsoft.com/dotnet/api/azure.identity.azureauthorityhosts?view=azure-dotnet) defines authorities for well-known clouds.
[AzureAuthorityHosts](https://learn.microsoft.com/dotnet/api/azure.identity.azureauthorityhosts?view=azure-dotnet) defines authorities for well-known clouds.

2. Set the `AZURE_AUTHORITY_HOST` environment variable to the appropriate authority host URL. For example, `https://login.microsoftonline.us/`. Note that this setting affects all credentials in the environment. Use the previous solution to set the authority host on a specific credential.

Expand Down

0 comments on commit a315ab8

Please sign in to comment.