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: articles/azure-app-configuration/quickstart-azure-kubernetes-service.md
+25-26Lines changed: 25 additions & 26 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -22,7 +22,7 @@ In this quickstart, you incorporate Azure App Configuration Kubernetes Provider
22
22
23
23
* An App Configuration store. [Create a store](./quickstart-azure-app-configuration-create.md#create-an-app-configuration-store).
24
24
* 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).
@@ -33,12 +33,11 @@ In this quickstart, you incorporate Azure App Configuration Kubernetes Provider
33
33
>
34
34
35
35
## 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).
38
37
39
38
### Create an application
40
39
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:
42
41
43
42
```dotnetcli
44
43
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
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.
72
71
73
72
```dotnetcli
74
73
dotnet publish -c Release -o published
@@ -116,9 +115,9 @@ In this section, it creates an ASP.NET Core web application that consumes enviro
116
115
117
116
### Deploy the application
118
117
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.
120
119
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.
122
121
123
122
```yaml
124
123
apiVersion: apps/v1
@@ -149,7 +148,7 @@ In this section, it creates an ASP.NET Core web application that consumes enviro
149
148
value: "Black"
150
149
```
151
150
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.
153
152
154
153
```yaml
155
154
apiVersion: v1
@@ -168,7 +167,7 @@ In this section, it creates an ASP.NET Core web application that consumes enviro
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
215
214
--create-namespace
216
215
```
217
216
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.
219
218
220
219
Replace the value of the `endpoint` field with the endpoint of your Azure App Configuration store.
221
220
@@ -231,16 +230,16 @@ Now that you have an application running in AKS, you'll deploy the App Configura
231
230
```
232
231
233
232
> [!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:
235
234
>
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.
240
239
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.
242
241
243
-
Replace the whole `env` section
242
+
Replace the `env` section
244
243
```yaml
245
244
env:
246
245
- name: Settings__Message
@@ -255,13 +254,13 @@ Now that you have an application running in AKS, you'll deploy the App Configura
255
254
name: configmap-created-by-appconfig-provider
256
255
```
257
256
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.
0 commit comments