Skip to content

Commit 3d8b9d5

Browse files
Address the comments
1 parent 445cbdf commit 3d8b9d5

File tree

1 file changed

+25
-26
lines changed

1 file changed

+25
-26
lines changed

articles/azure-app-configuration/quickstart-azure-kubernetes-service.md

Lines changed: 25 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ In this quickstart, you incorporate Azure App Configuration Kubernetes Provider
2222

2323
* An App Configuration store. [Create a store](./quickstart-azure-app-configuration-create.md#create-an-app-configuration-store).
2424
* An Azure Container Registry. [Create a registry](/azure/aks/tutorial-kubernetes-prepare-acr#create-an-azure-container-registry).
25-
* An Azure Kubernetes Service (AKS) cluster that integrates with the Azure Container Registry you created. [Create an AKS cluster](/azure/aks/tutorial-kubernetes-deploy-cluster#create-a-kubernetes-cluster).
25+
* An Azure Kubernetes Service (AKS) cluster that is granted permission to pull images from your Azure Container Registry. [Create an AKS cluster](/azure/aks/tutorial-kubernetes-deploy-cluster#create-a-kubernetes-cluster).
2626
* [.NET Core SDK](https://dotnet.microsoft.com/download)
2727
* [Azure CLI](/cli/azure/install-azure-cli)
2828
* [helm](https://helm.sh/docs/intro/install/)
@@ -33,12 +33,11 @@ In this quickstart, you incorporate Azure App Configuration Kubernetes Provider
3333
>
3434
3535
## Create an application running in AKS
36-
37-
In this section, it creates an ASP.NET Core web application that consumes environment variables as configuration and run it in Azure Kubernetes Service. This section has nothing to do with Azure App Configuration or Azure App Configuration Kubernetes Provider, it just for demonstrating the end-to-end usage scenario of Azure App Configuration Kubernetes Provider later. If you already have an application that is consuming environment variables in Kubernetes, you can just skip this section and go to [Use App Configuration Kubernetes Provider](#use-app-configuration-kubernetes-provider).
36+
In this section, you will create a simple ASP.NET Core web application running in Azure Kubernetes Service (AKS). The application reads configuration from the environment variables defined in a Kubernetes deployment. In the next section, you will enable it to consume configuration from Azure App Configuration without changing the application code. If you already have an AKS application that reads configuration from environment variables, you can skip this section and go to [Use App Configuration Kubernetes Provider](#use-app-configuration-kubernetes-provider).
3837

3938
### Create an application
4039

41-
1. Use the .NET Core command-line interface (CLI) and run the following command to create a new ASP.NET Core web app project in a new MyWebApp directory:
40+
1. Use the .NET Core command-line interface (CLI) and run the following command to create a new ASP.NET Core web app project in a new *MyWebApp* directory:
4241

4342
```dotnetcli
4443
dotnet new webapp --output MyWebApp --framework net6.0
@@ -57,18 +56,18 @@ In this section, it creates an ASP.NET Core web application that consumes enviro
5756
5857
<style>
5958
h1 {
60-
color: @Configuration.GetSection("Settings")["FontColor"];
59+
color: @Configuration["Settings:FontColor"];
6160
}
6261
</style>
6362
6463
<div class="text-center">
65-
<h1 class="display-4">@Configuration.GetSection("Settings")["Message"]</h1>
64+
<h1 class="display-4">@Configuration["Settings:Message"]</h1>
6665
</div>
6766
```
6867
6968
### Containerize the application
7069
71-
1. Run the [dotnet publish](/dotnet/core/tools/dotnet-publish) command to build the app in release mode and create the assets in the published folder.
70+
1. Run the [dotnet publish](/dotnet/core/tools/dotnet-publish) command to build the app in release mode and create the assets in the *published* folder.
7271
7372
```dotnetcli
7473
dotnet publish -c Release -o published
@@ -116,9 +115,9 @@ In this section, it creates an ASP.NET Core web application that consumes enviro
116115
117116
### Deploy the application
118117
119-
1. Create an *AKS-AppConfiguration-Demo* directory in the root directory of your project.
118+
1. Create an *Deployment* directory in the root directory of your project.
120119
121-
1. Add a *deployment.yaml* file to the *AKS-AppConfiguration-Demo* directory with the following content to create a deployment. Replace the value of `template.spec.containers.image` with the image you created in the previous step.
120+
1. Add a *deployment.yaml* file to the *Deployment* directory with the following content to create a deployment. Replace the value of `template.spec.containers.image` with the image you created in the previous step.
122121
123122
```yaml
124123
apiVersion: apps/v1
@@ -149,7 +148,7 @@ In this section, it creates an ASP.NET Core web application that consumes enviro
149148
value: "Black"
150149
```
151150
152-
1. Add a *service.yaml* file to the *AKS-AppConfiguration-Demo* directory with the following content to create a LoadBalancer service.
151+
1. Add a *service.yaml* file to the *Deployment* directory with the following content to create a LoadBalancer service.
153152
154153
```yaml
155154
apiVersion: v1
@@ -168,7 +167,7 @@ In this section, it creates an ASP.NET Core web application that consumes enviro
168167
169168
```console
170169
kubectl create namespace appconfig-demo
171-
kubectl apply -f ./AKS-AppConfiguration-Demo -n appconfig-demo
170+
kubectl apply -f ./Deployment -n appconfig-demo
172171
```
173172
174173
1. Run the following command and get the External IP address exposed by the LoadBalancer service.
@@ -215,7 +214,7 @@ Now that you have an application running in AKS, you'll deploy the App Configura
215214
--create-namespace
216215
```
217216
218-
1. Add an *appConfigurationProvider.yaml* file to the *AKS-AppConfiguration-Demo* directory with the following content to create an `AzureAppConfigurationProvider` resource. `AzureAppConfigurationProvider` is a custom resource that defines how to retrieve key-values from an Azure App Configuration store and create a configMap.
217+
1. Add an *appConfigurationProvider.yaml* file to the *Deployment* directory with the following content to create an `AzureAppConfigurationProvider` resource. `AzureAppConfigurationProvider` is a custom resource that defines what data to download from an Azure App Configuration store and creates a ConfigMap.
219218
220219
Replace the value of the `endpoint` field with the endpoint of your Azure App Configuration store.
221220
@@ -231,16 +230,16 @@ Now that you have an application running in AKS, you'll deploy the App Configura
231230
```
232231
233232
> [!NOTE]
234-
> `AzureAppConfigurationProvider` is a declarative API, it defines the desired state of the configMap that retrieves the key-values from the App Configuration store with following behavior:
233+
> `AzureAppConfigurationProvider` is a declarative API, it defines the desired state of the ConfigMap that retrieves the key-values from the App Configuration store with following behavior:
235234
>
236-
> - The provider creates a configMap according to the definition of an `AzureAppConfigurationProvider`.
237-
> - The provider doesn't update a configMap that is not created by the provider.
238-
> - The provider keeps the data of configMap as a mirror of key-values from Azure App Configuration. Any changes to the configMap through other approaches will be reverted.
239-
> - Deleting provider will delete the corresponding configMap along with it. If the configMap is deleted solely, the provider will recreate it.
235+
> - The ConfigMap will be recreated if it's deleted by any other means.
236+
> - The ConfigMap will be overwritten based on the data in your App Configuration store at the moment if it's modified by any other means.
237+
> - The ConfigMap will be deleted if the App Configuration Kubernetes Provider is uninstalled.
238+
> - The provider doesn't update a preexisting ConfigMap that is not created by the provider.
240239
241-
1. Update the *deployment.yaml* file in *AKS-AppConfiguration-Demo* directory to use the configMap `configmap-created-by-appconfig-provider` as environment variable.
240+
2. Update the *deployment.yaml* file in the *Deployment* directory to use the ConfigMap `configmap-created-by-appconfig-provider` for environment variable.
242241
243-
Replace the whole `env` section
242+
Replace the `env` section
244243
```yaml
245244
env:
246245
- name: Settings__Message
@@ -255,13 +254,13 @@ Now that you have an application running in AKS, you'll deploy the App Configura
255254
name: configmap-created-by-appconfig-provider
256255
```
257256
258-
2. Run the following command to deploy the *appConfigurationProvider.yaml* and *deployment.yaml*.
257+
3. Run the following command to deploy the changes. Replace the namespace if you are using your existing AKS application.
259258
260259
```console
261-
kubectl apply -f ./AKS-AppConfiguration-Demo -n appconfig-demo
260+
kubectl apply -f ./Deployment -n appconfig-demo
262261
```
263262
264-
3. Refresh the browser. The page shows updated content.
263+
4. Refresh the browser. The page shows updated content.
265264
266265
![Kubernetes Provider after using configMap](./media/quickstarts/kubernetes-provider-app-launch-after.png)
267266
@@ -304,21 +303,21 @@ Use the logs for further troubleshooting. For example, if you see requests to yo
304303

305304
## Clean up resources
306305

307-
[!INCLUDE[Azure App Configuration cleanup](../../includes/azure-app-configuration-cleanup.md)]
308-
309306
Remove the resources that have been deployed to AKS.
310307

311308
```console
312-
kubectl delete -f ./AKS-AppConfiguration-Demo -n appconfig-demo
309+
kubectl delete -f ./Deployment -n appconfig-demo
313310
kubectl delete namespace appconfig-demo
314311
```
315312

316-
Uninstall the Azure App Configuration Kubernetes Provider from your AKS cluster.
313+
Uninstall the App Configuration Kubernetes Provider from your AKS cluster if you want to keep the AKS cluster.
317314

318315
```console
319316
helm uninstall azureappconfiguration.kubernetesprovider --namespace azappconfig-system
320317
```
321318

319+
[!INCLUDE[Azure App Configuration cleanup](../../includes/azure-app-configuration-cleanup.md)]
320+
322321
## Summary
323322

324323
In this quickstart, you:

0 commit comments

Comments
 (0)