Skip to content

Commit 37c0632

Browse files
Merge pull request #267209 from linglingye001/linglingye/fixFilePath
Kubernetes provider: fix mount path
2 parents 63048b8 + 24847e3 commit 37c0632

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

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

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ In this section, you will create a simple ASP.NET Core web application running i
7070
</div>
7171
```
7272
73-
1. Create a file named *mysettings.json* at the root of your project directory, and enter the following content.
73+
1. Create a *config* directory in the root of your project and add a *mysettings.json* file to it with the following content.
7474
7575
```json
7676
{
@@ -88,7 +88,7 @@ In this section, you will create a simple ASP.NET Core web application running i
8888
// ... ...
8989
9090
// Add a JSON configuration source
91-
builder.Configuration.AddJsonFile("mysettings.json");
91+
builder.Configuration.AddJsonFile("config/mysettings.json", reloadOnChange: true, optional: false);
9292
9393
var app = builder.Build();
9494
@@ -263,7 +263,7 @@ Add following key-values to the App Configuration store and leave **Label** and
263263
> - The ConfigMap will be reset based on the present data in your App Configuration store if it's deleted or modified by any other means.
264264
> - The ConfigMap will be deleted if the App Configuration Kubernetes Provider is uninstalled.
265265
266-
2. Update the *deployment.yaml* file in the *Deployment* directory to use the ConfigMap `configmap-created-by-appconfig-provider` as a mounted data volume. It is important to ensure that the `volumeMounts.mountPath` matches the `WORKDIR` specified in your *Dockerfile*.
266+
2. Update the *deployment.yaml* file in the *Deployment* directory to use the ConfigMap `configmap-created-by-appconfig-provider` as a mounted data volume. It is important to ensure that the `volumeMounts.mountPath` matches the `WORKDIR` specified in your *Dockerfile* and the *config* directory created before.
267267
268268
```yaml
269269
apiVersion: apps/v1
@@ -289,14 +289,11 @@ Add following key-values to the App Configuration store and leave **Label** and
289289
- containerPort: 80
290290
volumeMounts:
291291
- name: config-volume
292-
mountPath: /app
292+
mountPath: /app/config
293293
volumes:
294294
- name: config-volume
295295
configMap:
296296
name: configmap-created-by-appconfig-provider
297-
items:
298-
- key: mysettings.json
299-
path: mysettings.json
300297
```
301298
302299
3. Run the following command to deploy the changes. Replace the namespace if you are using your existing AKS application.

0 commit comments

Comments
 (0)