Skip to content

Commit aa6b5bf

Browse files
maud-lvyungezz
andauthored
Apply suggestions from code review
Co-authored-by: Yunge Zhu <[email protected]>
1 parent 66f8fff commit aa6b5bf

File tree

1 file changed

+33
-16
lines changed

1 file changed

+33
-16
lines changed

articles/service-connector/tutorial-connect-web-app-app-configuration.md

Lines changed: 33 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,11 @@ Start by creating your Azure resources.
6969

7070
* *location* &rarr; A location near you, for example `eastus`. Use `az account list-locations --output table` to list locations.
7171
* *resource-group* &rarr; You will use this resource group to organize all the Azure resources needed to complete this tutorial. (for example, `service-connector-tutorial-rg`)
72-
* *name* &rarr; The app service name is used as both the name of the resource in Azure and to form the fully qualified domain name for your app in the form of the server endpoint `https://<app-service-name>.azurewebsites.com`. This name must be **unique across all Azure** and the only allowed characters are `A`-`Z`, `0`-`9`, and `-`. For example, use `webapp-appconfig-smi-\<unique-id>` where `\<unique-id>` is any three characters.
72+
| Parameter | Description | Example |
73+
|--------------|-----------------------------------------------------------------------------------------|----------|
74+
| Location | Choose a location near you. Use `az account list-locations --output table` to list locations. | *eastus* |
75+
| Resource group name | You will use this resource group to organize all the Azure resources needed to complete this tutorial. | *service-connector-tutorial-rg* |
76+
| App service name | The app service name is used as the name of the resource in Azure and to form the fully qualified domain name for your app, in the form of the server endpoint `https://<app-service-name>.azurewebsites.com`. This name must be unique across all Azure and the only allowed characters are `A`-`Z`, `0`-`9`, and `-`. | *webapp-appconfig-smi* |
7377

7478
### [UMI](#tab/umi)
7579

@@ -90,7 +94,11 @@ Start by creating your Azure resources.
9094

9195
* *location* &rarr; A location near you, for example `eastus`. Use `az account list-locations --output table` to list locations.
9296
* *resource-group* &rarr; You will use this resource group to organize all the Azure resources needed to complete this tutorial. (for example, `service-connector-tutorial-rg`)
93-
* *name* &rarr; The app service name is used as both the name of the resource in Azure and to form the fully qualified domain name for your app in the form of the server endpoint `https://<app-service-name>.azurewebsites.com`. This name must be **unique across all Azure** and the only allowed characters are `A`-`Z`, `0`-`9`, and `-`. For example, use `webapp-appconfig-umi-\<unique-id>` where `\<unique-id>` is any three characters.
97+
| Parameter | Description | Example |
98+
|--------------|-----------------------------------------------------------------------------------------|----------|
99+
| Location | Choose a location near you. Use `az account list-locations --output table` to list locations. | *eastus* |
100+
| Resource group name | You will use this resource group to organize all the Azure resources needed to complete this tutorial. | *service-connector-tutorial-rg* |
101+
| App service name | The app service name is used as the name of the resource in Azure and to form the fully qualified domain name for your app, in the form of the server endpoint `https://<app-service-name>.azurewebsites.com`. This name must be unique across all Azure and the only allowed characters are `A`-`Z`, `0`-`9`, and `-`. | *webapp-appconfig-umi* |
94102

95103
Create a user-assigned managed idendity. Save the output into a temporary notepad.
96104
```azurecli
@@ -116,7 +124,11 @@ Start by creating your Azure resources.
116124

117125
* *location* &rarr; A location near you, for example `eastus`. Use `az account list-locations --output table` to list locations.
118126
* *resource-group* &rarr; You will use this resource group to organize all the Azure resources needed to complete this tutorial. (for example, `service-connector-tutorial-rg`)
119-
* *name* &rarr; The app service name is used as both the name of the resource in Azure and to form the fully qualified domain name for your app in the form of the server endpoint `https://<app-service-name>.azurewebsites.com`. This name must be **unique across all Azure** and the only allowed characters are `A`-`Z`, `0`-`9`, and `-`. For example, use `webapp-appconfig-sp-\<unique-id>` where `\<unique-id>` is any three characters.
127+
| Parameter | Description | Example |
128+
|--------------|-----------------------------------------------------------------------------------------|----------|
129+
| Location | Choose a location near you. Use `az account list-locations --output table` to list locations. | *eastus* |
130+
| Resource group name | You will use this resource group to organize all the Azure resources needed to complete this tutorial. | *service-connector-tutorial-rg* |
131+
| App service name | The app service name is used as the name of the resource in Azure and to form the fully qualified domain name for your app, in the form of the server endpoint `https://<app-service-name>.azurewebsites.com`. This name must be unique across all Azure and the only allowed characters are `A`-`Z`, `0`-`9`, and `-`. | *webapp-appconfig-sp* |
120132

121133
Create a service pricipal, make sure replace the `yourSubscriptionID` with your actual subscription ID. Save the output into a temporary notepad.
122134

@@ -143,7 +155,11 @@ Start by creating your Azure resources.
143155

144156
* *location* &rarr; A location near you, for example `eastus`. Use `az account list-locations --output table` to list locations.
145157
* *resource-group* &rarr; You will use this resource group to organize all the Azure resources needed to complete this tutorial. (for example, `service-connector-tutorial-rg`)
146-
* *name* &rarr; The app service name is used as both the name of the resource in Azure and to form the fully qualified domain name for your app in the form of the server endpoint `https://<app-service-name>.azurewebsites.com`. This name must be **unique across all Azure** and the only allowed characters are `A`-`Z`, `0`-`9`, and `-`. For example, use `webapp-appconfig-cs-\<unique-id>` where `\<unique-id>` is any three characters.
158+
| Parameter | Description | Example |
159+
|--------------|-----------------------------------------------------------------------------------------|----------|
160+
| Location | Choose a location near you. Use `az account list-locations --output table` to list locations. | *eastus* |
161+
| Resource group name | You will use this resource group to organize all the Azure resources needed to complete this tutorial. | *service-connector-tutorial-rg* |
162+
| App service name | The app service name is used as the name of the resource in Azure and to form the fully qualified domain name for your app, in the form of the server endpoint `https://<app-service-name>.azurewebsites.com`. This name must be unique across all Azure and the only allowed characters are `A`-`Z`, `0`-`9`, and `-`. | *webapp-appconfig-cs* |
147163

148164
---
149165

@@ -161,8 +177,8 @@ Start by creating your Azure resources.
161177

162178
Import the test configuration file to Azure App Configuration using a system-assigned managed identity.
163179

164-
1. Cd into the folder `serviceconnector-webapp-appconfig-dotnet\system-managed-identity\Microsoft.Azure.ServiceConnector.Sample`
165-
1. Import the [./sampleconfigs.json](https://github.com/Azure-Samples/serviceconnector-webapp-appconfig-dotnet/blob/main/system-managed-identity/Microsoft.Azure.ServiceConnector.Sample/sampleconfigs.json) test configuration file into the App Configuration store. If you're using Cloud Shell, upload [sampleconfigs.json](../cloud-shell/persisting-shell-storage.md) before running the command.
180+
1. Cd into the folder `serviceconnector-webapp-appconfig-dotnet\system-managed-identity\ServiceConnectorSample`
181+
1. Import the [./sampleconfigs.json](https://github.com/Azure-Samples/serviceconnector-webapp-appconfig-dotnet/blob/main/system-managed-identity/ServiceConnectorSample/sampleconfigs.json) test configuration file into the App Configuration store. If you're using Cloud Shell, upload [sampleconfigs.json](../cloud-shell/persisting-shell-storage.md) before running the command.
166182
167183
```azurecli
168184
az appconfig kv import -n $APP_CONFIG_NAME --source file --format json --path ./sampleconfigs.json --separator : --yes
@@ -172,8 +188,8 @@ Start by creating your Azure resources.
172188
173189
Import the test configuration file to Azure App Configuration using a user-assigned managed identity.
174190
175-
1. Cd into the folder `serviceconnector-webapp-appconfig-dotnet\user-assigned-managed-identity\Microsoft.Azure.ServiceConnector.Sample`
176-
1. Import the [./sampleconfigs.json](https://github.com/Azure-Samples/serviceconnector-webapp-appconfig-dotnet/blob/main/user-assigned-managed-identity/Microsoft.Azure.ServiceConnector.Sample/sampleconfigs.json) test configuration file into the App Configuration store. If you're using Cloud Shell, upload [sampleconfigs.json](../cloud-shell/persisting-shell-storage.md) before running the command.
191+
1. Cd into the folder `serviceconnector-webapp-appconfig-dotnet\user-assigned-managed-identity\ServiceConnectorSample`
192+
1. Import the [./sampleconfigs.json](https://github.com/Azure-Samples/serviceconnector-webapp-appconfig-dotnet/blob/main/user-assigned-managed-identity/ServiceConnectorSample/sampleconfigs.json) test configuration file into the App Configuration store. If you're using Cloud Shell, upload [sampleconfigs.json](../cloud-shell/persisting-shell-storage.md) before running the command.
177193

178194
```azurecli
179195
az appconfig kv import -n $APP_CONFIG_NAME --source file --format json --path ./sampleconfigs.json --separator : --yes
@@ -183,8 +199,8 @@ Start by creating your Azure resources.
183199

184200
Import the test configuration file to Azure App Configuration using service principal.
185201

186-
1. Cd into the folder `serviceconnector-webapp-appconfig-dotnet\service-principal\Microsoft.Azure.ServiceConnector.Sample`
187-
1. Import the [./sampleconfigs.json](https://github.com/Azure-Samples/serviceconnector-webapp-appconfig-dotnet/blob/main/service-principal/Microsoft.Azure.ServiceConnector.Sample/sampleconfigs.json) test configuration file into the App Configuration store. If you're using Cloud Shell, upload [sampleconfigs.json](../cloud-shell/persisting-shell-storage.md) before running the command.
202+
1. Cd into the folder `serviceconnector-webapp-appconfig-dotnet\service-principal\ServiceConnectorSample`
203+
1. Import the [./sampleconfigs.json](https://github.com/Azure-Samples/serviceconnector-webapp-appconfig-dotnet/blob/main/service-principal/ServiceConnectorSample/sampleconfigs.json) test configuration file into the App Configuration store. If you're using Cloud Shell, upload [sampleconfigs.json](../cloud-shell/persisting-shell-storage.md) before running the command.
188204
189205
```azurecli
190206
az appconfig kv import -n $APP_CONFIG_NAME --source file --format json --path ./sampleconfigs.json --separator : --yes
@@ -194,8 +210,8 @@ Start by creating your Azure resources.
194210
195211
Import the test configuration file to Azure App Configuration using a connection string.
196212
197-
1. Cd into the folder `serviceconnector-webapp-appconfig-dotnet\connection-string\Microsoft.Azure.ServiceConnector.Sample`
198-
1. Import the [./sampleconfigs.json](https://github.com/Azure-Samples/serviceconnector-webapp-appconfig-dotnet/blob/main/connection-string/Microsoft.Azure.ServiceConnector.Sample/sampleconfigs.json) test configuration file into the App Configuration store. If you're using Cloud Shell, upload [sampleconfigs.json](../cloud-shell/persisting-shell-storage.md) before running the command.
213+
1. Cd into the folder `serviceconnector-webapp-appconfig-dotnet\connection-string\ServiceConnectorSample`
214+
1. Import the [./sampleconfigs.json](https://github.com/Azure-Samples/serviceconnector-webapp-appconfig-dotnet/blob/main/connection-string/ServiceConnectorSample/sampleconfigs.json) test configuration file into the App Configuration store. If you're using Cloud Shell, upload [sampleconfigs.json](../cloud-shell/persisting-shell-storage.md) before running the command.
199215

200216
```azurecli
201217
az appconfig kv import -n $APP_CONFIG_NAME --source file --format json --path ./sampleconfigs.json --separator : --yes
@@ -266,22 +282,23 @@ Find below what Service Connector manages behind the scenes for each authenticat
266282
267283
Service Connector manages the connection configuration for you:
268284
269-
- Set up the web app's `AZURE_APPCONFIGURATION_ENDPOINT` to let the application access it and get the App Configuration endpoint. Access [sample code](https://github.com/Azure-Samples/serviceconnector-webapp-appconfig-dotnet/blob/main/system-managed-identity/Microsoft.Azure.ServiceConnector.Sample/Program.cs#L37).
270-
- Activate the web app's system-assigned managed authentication and grant App Configuration a Data Reader role to let the application authenticate to the App Configuration using DefaultAzureCredential from Azure.Identity. Access [sample code](https://github.com/Azure-Samples/serviceconnector-webapp-appconfig-dotnet/blob/main/system-managed-identity/Microsoft.Azure.ServiceConnector.Sample/Program.cs#L43).
285+
- Set up the web app's `AZURE_APPCONFIGURATION_ENDPOINT` to let the application access it and get the App Configuration endpoint. Access [sample code](https://github.com/Azure-Samples/serviceconnector-webapp-appconfig-dotnet/blob/main/system-managed-identity/ServiceConnectorSample/Program.cs#L10).
286+
- Activate the web app's system-assigned managed authentication and grant App Configuration a Data Reader role to let the application authenticate to the App Configuration using DefaultAzureCredential from Azure.Identity. Access [sample code](https://github.com/Azure-Samples/serviceconnector-webapp-appconfig-dotnet/blob/main/system-managed-identity/ServiceConnectorSample/Program.cs#L13).
271287
272288
### [UMI](#tab/umi)
273289
274290
Service Connector manages the connection configuration for you:
275291
276-
- Set up the web app's `AZURE_APPCONFIGURATION_ENDPOINT` to let the application access it and get the App Configuration endpoint. Access [sample code](https://github.com/Azure-Samples/serviceconnector-webapp-appconfig-dotnet/blob/main/user-assigned-managed-identity/Microsoft.Azure.ServiceConnector.Sample/Program.cs#L37).
292+
- Setup the web app's `AZURE_APPCONFIGURATION_ENDPOINT`, `AZURE_APPCONFIGURATION_CLIENTID`
293+
to let the application access it and get app configuration endpoint in [code](https://github.com/Azure-Samples/serviceconnector-webapp-appconfig-dotnet/blob/main/user-assigned-managed-identity/ServiceConnectorSample/Program.cs#L10-L12);
277294
- Activate the web app's user-assigned managed authentication and grant App Configuration a Data Reader role to let the application authenticate to the App Configuration using DefaultAzureCredential from Azure.Identity. Access [sample code](https://github.com/Azure-Samples/serviceconnector-webapp-appconfig-dotnet/blob/main/user-assigned-managed-identity/ServiceConnectorSample/Program.cs#L16).
278295
279296
### [Service principal](#tab/serviceprincipal)
280297
281298
Service Connector manages the connection configuration for you:
282299
283300
- Set up the web app's `AZURE_APPCONFIGURATION_ENDPOINT` to let the application access it and get the App Configuration endpoint. Access [sample code](https://github.com/Azure-Samples/serviceconnector-webapp-appconfig-dotnet/blob/main/service-principal/ServiceConnectorSample/Program.cs#L10).
284-
- Activate the web app's system-assigned managed authentication and grant App Configuration a Data Reader role to let the application authenticate to the App Configuration using DefaultAzureCredential from Azure.Identity. Access [sample code](https://github.com/Azure-Samples/serviceconnector-webapp-appconfig-dotnet/blob/main/service-principal/Microsoft.Azure.ServiceConnector.Sample/Program.cs#L43).
301+
- save service principal credential to WebApp AppSettings `AZURE_APPCONFIGURATION_CLIENTID`. `AZURE_APPCONFIGURATION_TENANTID`, `AZURE_APPCONFIGURATION_CLIENTSECRET` and grant App Configuration Data Reader role to the service principal, so the application could be authenticated to the App Configuration in [code](https://github.com/Azure-Samples/serviceconnector-webapp-appconfig-dotnet/blob/main/service-principal/ServiceConnectorSample/Program.cs#L11-L18), by using `ClientSecretCredential` from [Azure.Identity](https://azuresdkdocs.blob.core.windows.net/$web/dotnet/Azure.Identity/1.0.0/api/index.html).
285302

286303
### [Connection string](#tab/connectionstring)
287304

0 commit comments

Comments
 (0)