Skip to content

Commit 87fc1c7

Browse files
authored
Merge pull request #310442 from jimmyca15/user/jimmyca/audienceSupport
Add section about how to specify App Configuration audience in configuration provider and SDK in .NET
2 parents 4bb6ac9 + d5c8e0f commit 87fc1c7

2 files changed

Lines changed: 62 additions & 11 deletions

File tree

articles/azure-app-configuration/concept-enable-rbac.md

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,5 +60,66 @@ Follow these steps to assign App Configuration Data roles to your credential.
6060
3. On the **Members** tab, follow the wizard to select the credential you're granting access to and then select **Next**.
6161
4. Finally, on the **Review + assign** tab, select **Review + assign** to assign the role.
6262

63+
## Configuring cloud-specific audience for Entra ID authentication
64+
65+
When using Entra ID and the following Azure App Configuration libraries in clouds other than Azure cloud, Azure Government, and Microsoft Azure operated by 21Vianet, an appropriate Entra ID audience must be configured to enable authentication.
66+
67+
### [.NET](#tab/dotnet)
68+
69+
The Audience for the target cloud must be configured for the following packages.
70+
71+
- Azure SDK for .NET: Azure.Data.AppConfiguration >= 1.6.0
72+
- .NET configuration provider: Microsoft.Extensions.Configuration.AzureAppConfiguration >= 8.2.0
73+
74+
In the **Azure SDK for .NET**, audience is configured by utilizing the following API calls:
75+
76+
* The ConfigurationClient constructor [accepts ConfigurationClientOptions](/dotnet/api/azure.data.appconfiguration.configurationclient.-ctor#azure-data-appconfiguration-configurationclient-ctor(system-uri-azure-core-tokencredential-azure-data-appconfiguration-configurationclientoptions))
77+
* ConfigurationClientOptions allows [Audience](/dotnet/api/azure.data.appconfiguration.configurationclientoptions.audience#azure-data-appconfiguration-configurationclientoptions-audience) to be set
78+
79+
The following code snippet demonstrates how to instantiate a configuration client with a cloud-specific audience.
80+
81+
```
82+
var configurationClient = new ConfigurationClient(
83+
myStoreEndpoint,
84+
new DefaultAzureCredential(),
85+
new ConfigurationClientOptions
86+
{
87+
Audience = "{Cloud specific audience here}"
88+
});
89+
```
90+
91+
In the **.NET configuration provider**, audience is configured by utilizing the following API calls:
92+
93+
* AzureAppConfigurationOptions exposes a [ConfigureClientOptions](/dotnet/api/microsoft.extensions.configuration.azureappconfiguration.azureappconfigurationoptions.configureclientoptions#microsoft-extensions-configuration-azureappconfiguration-azureappconfigurationoptions-configureclientoptions(system-action((azure-data-appconfiguration-configurationclientoptions)))) method
94+
95+
The following code snippet demonstrates how to add the Azure App Configuration provider into a .NET application with a cloud-specific audience.
96+
97+
```
98+
builder.AddAzureAppConfiguration(o =>
99+
{
100+
o.Connect(
101+
myStoreEndpoint,
102+
new DefaultAzureCredential());
103+
104+
o.ConfigureClientOptions(clientOptions => clientOptions.Audience = "{Cloud specific audience here}");
105+
});
106+
```
107+
108+
---
109+
110+
### Audience
111+
112+
For Azure App Configuration in the global Azure cloud, use the following audience:
113+
114+
`https://appconfig.azure.com`
115+
116+
For Azure App Configuration in the national clouds, use the applicable audience specified in the table below:
117+
118+
| **National cloud** | **Audience** |
119+
| ------------------------------------ | ----------------------------------- |
120+
| Azure Government | `https://appconfig.azure.us` |
121+
| Microsoft Azure operated by 21Vianet | `https://appconfig.azure.cn` |
122+
| Bleu | `https://appconfig.sovcloud-api.fr` |
123+
63124
## Next steps
64125
Learn how to [use managed identities to access your App Configuration store](howto-integrate-azure-managed-service-identity.md).

articles/azure-app-configuration/rest-api-authentication-azure-ad.md

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -39,17 +39,7 @@ Before acquiring a Microsoft Entra token, you must identify what user you want t
3939

4040
Request the Microsoft Entra token with a proper audience. The audience can also be referred to as the *resource* that the token is being requested for.
4141

42-
For Azure App Configuration in the global Azure cloud, use the following audience:
43-
44-
`https://appconfig.azure.com`
45-
46-
For Azure App Configuration in the national clouds, use the applicable audience specified in the table below:
47-
48-
| **National cloud** | **Audience** |
49-
| ------------------------------------ | ----------------------------------- |
50-
| Azure Government | `https://appconfig.azure.us` |
51-
| Microsoft Azure operated by 21Vianet | `https://appconfig.azure.cn` |
52-
| Bleu | `https://appconfig.sovcloud-api.fr` |
42+
For details on which audience to use for which cloud, refer to the [audience section of the Entra ID access overview](./concept-enable-rbac.md#audience).
5343

5444
<a name='azure-ad-authority'></a>
5545

0 commit comments

Comments
 (0)