Skip to content

Commit 8ff8b25

Browse files
Merge pull request #49131 from wwlpublish/3353babb84a7da013205f917b7a3adec7ac38b34763dfd6bf40d11ac40d215ce-live
Modules/M02-configure-web-app-settings
2 parents 1b183a6 + 3e496cc commit 8ff8b25

14 files changed

+57
-43
lines changed

learn-pr/wwl-azure/configure-web-app-settings/1-introduction.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@ metadata:
66
prefetch-feature-rollout: true
77
title: Introduction
88
description: "Introduction"
9-
ms.date: 06/11/2024
9+
ms.date: 02/12/2025
1010
author: wwlpublish
1111
ms.author: jeffko
1212
ms.topic: unit
1313
ms.custom:
1414
- N/A
1515
durationInMinutes: 3
1616
content: |
17-
[!include[](includes/1-introduction.md)]
17+
[!include[](includes/1-introduction.md)]

learn-pr/wwl-azure/configure-web-app-settings/2-configure-application-settings.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@ metadata:
66
prefetch-feature-rollout: true
77
title: Configure application settings
88
description: "Configure application settings"
9-
ms.date: 06/11/2024
9+
ms.date: 02/12/2025
1010
author: wwlpublish
1111
ms.author: jeffko
1212
ms.topic: unit
1313
ms.custom:
1414
- N/A
1515
durationInMinutes: 5
1616
content: |
17-
[!include[](includes/2-configure-application-settings.md)]
17+
[!include[](includes/2-configure-application-settings.md)]

learn-pr/wwl-azure/configure-web-app-settings/3-configure-general-settings.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@ metadata:
66
prefetch-feature-rollout: true
77
title: Configure general settings
88
description: "Configure general settings"
9-
ms.date: 06/11/2024
9+
ms.date: 02/12/2025
1010
author: wwlpublish
1111
ms.author: jeffko
1212
ms.topic: unit
1313
ms.custom:
1414
- N/A
1515
durationInMinutes: 4
1616
content: |
17-
[!include[](includes/3-configure-general-settings.md)]
17+
[!include[](includes/3-configure-general-settings.md)]

learn-pr/wwl-azure/configure-web-app-settings/4-configure-path-mappings.yml

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,12 @@ metadata:
66
prefetch-feature-rollout: true
77
title: Configure path mappings
88
description: "Configure path mappings"
9-
ms.date: 06/11/2024
9+
ms.date: 02/12/2025
1010
author: wwlpublish
1111
ms.author: jeffko
1212
ms.topic: unit
1313
ms.custom:
14-
- N/A
15-
- linux-related-content
14+
- N/A
1615
durationInMinutes: 3
1716
content: |
18-
[!include[](includes/4-configure-path-mappings.md)]
19-
17+
[!include[](includes/4-configure-path-mappings.md)]

learn-pr/wwl-azure/configure-web-app-settings/5-enable-diagnostic-logging.yml

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,12 @@ metadata:
66
prefetch-feature-rollout: true
77
title: Enable diagnostic logging
88
description: "Enable diagnostic logging"
9-
ms.date: 06/11/2024
9+
ms.date: 02/12/2025
1010
author: wwlpublish
1111
ms.author: jeffko
1212
ms.topic: unit
1313
ms.custom:
14-
- N/A
15-
- linux-related-content
14+
- N/A
1615
durationInMinutes: 6
1716
content: |
18-
[!include[](includes/5-enable-diagnostic-logging.md)]
19-
17+
[!include[](includes/5-enable-diagnostic-logging.md)]

learn-pr/wwl-azure/configure-web-app-settings/6-configure-security-certificates.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@ metadata:
66
prefetch-feature-rollout: true
77
title: Configure security certificates
88
description: "Configure security certificates"
9-
ms.date: 06/11/2024
9+
ms.date: 02/12/2025
1010
author: wwlpublish
1111
ms.author: jeffko
1212
ms.topic: unit
1313
ms.custom:
1414
- N/A
1515
durationInMinutes: 4
1616
content: |
17-
[!include[](includes/6-configure-security-certificates.md)]
17+
[!include[](includes/6-configure-security-certificates.md)]

learn-pr/wwl-azure/configure-web-app-settings/7-knowledge-check.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ metadata:
66
prefetch-feature-rollout: true
77
title: Knowledge check
88
description: "Knowledge check"
9-
ms.date: 06/11/2024
9+
ms.date: 02/12/2025
1010
author: wwlpublish
1111
ms.author: jeffko
1212
ms.topic: unit
@@ -37,4 +37,4 @@ quiz:
3737
explanation: "Incorrect. Failed request tracing is not supported on the Linux platform."
3838
- content: "Deployment logging"
3939
isCorrect: true
40-
explanation: "Correct. Deployment logging is supported on the Linux platform."
40+
explanation: "Correct. Deployment logging is supported on the Linux platform."

learn-pr/wwl-azure/configure-web-app-settings/8-summary.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@ metadata:
66
prefetch-feature-rollout: true
77
title: Summary
88
description: "Summary"
9-
ms.date: 06/11/2024
9+
ms.date: 02/12/2025
1010
author: wwlpublish
1111
ms.author: jeffko
1212
ms.topic: unit
1313
ms.custom:
1414
- N/A
1515
durationInMinutes: 2
1616
content: |
17-
[!include[](includes/8-summary.md)]
17+
[!include[](includes/8-summary.md)]

learn-pr/wwl-azure/configure-web-app-settings/includes/2-configure-application-settings.md

Lines changed: 25 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,24 @@
1-
In App Service, app settings are variables passed as environment variables to the application code. For Linux apps and custom containers, App Service passes app settings to the container using the `--env` flag to set the environment variable in the container.
1+
In App Service, app settings are variables passed as environment variables to the application code. For Linux apps and custom containers, App Service passes app settings to the container using the `--env` flag to set the environment variable in the container. In either case, they're injected into your app environment at app startup. When you add, remove, or edit app settings, App Service triggers an app restart.
22

3-
Application settings can be accessed by navigating to your app's management page and selecting **Environment variables > Application settings**.
3+
For ASP.NET and ASP.NET Core developers, setting app settings in App Service is like setting them in `<appSettings>` in *Web.config* or *appsettings.json*, but the values in App Service override the ones in *Web.config* or *appsettings.json*. You can keep development settings (for example, local MySQL password) in *Web.config* or *appsettings.json* and production secrets (for example, Azure MySQL database password) safely in App Service. The same code uses your development settings when you debug locally, and it uses your production secrets when deployed to Azure.
44

5-
:::image type="content" source="../media/configure-app-settings.png" alt-text="Navigating to Environment variables > Application settings":::
5+
App settings are always encrypted when stored (encrypted-at-rest). App settings names can only contain letters, numbers (0-9), periods ("."), and underscores ("_")
6+
Special characters in the value of an App Setting must be escaped as needed by the target OS.
67

7-
For ASP.NET and ASP.NET Core developers, setting app settings in App Service is like setting them in `<appSettings>` in *Web.config* or *appsettings.json*, but the values in App Service override the ones in *Web.config* or *appsettings.json*. You can keep development settings (for example, local MySQL password) in *Web.config* or *appsettings.json* and production secrets (for example, Azure MySQL database password) safely in App Service. The same code uses your development settings when you debug locally, and it uses your production secrets when deployed to Azure.
8+
Application settings can be accessed by navigating to your app's management page and selecting **Environment variables > Application settings**.
89

9-
App settings are always encrypted when stored (encrypted-at-rest).
10+
:::image type="content" source="../media/configure-app-settings.png" alt-text="Screenshot of Navigating to Environment variables > Application settings.":::
1011

1112
## Adding and editing settings
1213

13-
To add a new app setting, select **+ Add**. If you're using deployment slots you can specify if your setting is swappable or not. In the dialog, you can stick the setting to the current slot.
14+
To add a new app setting, select **+ Add**. If you're using deployment slots, you can specify if your setting is swappable or not. In the dialog, you can stick the setting to the current slot.
1415

1516
:::image type="content" source="../media/app-configure-slotsetting.png" alt-text="Selecting deployment slot setting to stick the setting to the current slot.":::
1617

1718
When finished, select **Apply**. Don't forget to select **Apply** back in the **Environment variables** page.
1819

1920
> [!NOTE]
20-
> In a default Linux app service or a custom Linux container, any nested JSON key structure in the app setting name like `ApplicationInsights:InstrumentationKey` needs to be configured in App Service as `ApplicationInsights__InstrumentationKey` for the key name. In other words, any `:` should be replaced by `__` (double underscore). Any periods in the app setting name will be replaced with a `_` (single underscore).
21+
> In a default Linux app service or a custom Linux container, any nested JSON key structure in the app setting name like `ApplicationInsights:InstrumentationKey` needs to be configured in App Service as `ApplicationInsights__InstrumentationKey` for the key name. In other words, replace any `:` with `__` (double underscore). Any periods in the app setting name are replaced with a `_` (single underscore).
2122
2223
### Editing application settings in bulk
2324

@@ -44,7 +45,7 @@ To add or edit app settings in bulk, select the **Advanced edit** button. When f
4445
For ASP.NET and ASP.NET Core developers, setting connection strings in App Service are like setting them in `<connectionStrings>` in *Web.config*, but the values you set in App Service override the ones in *Web.config*. For other language stacks, it's better to use app settings instead, because connection strings require special formatting in the variable keys in order to access the values.
4546

4647
> [!TIP]
47-
> There is one case where you may want to use connection strings instead of app settings for non-.NET languages: certain Azure database types are backed up along with the app *only* if you configure a connection string for the database in your App Service app.
48+
> There's one case where you may want to use connection strings instead of app settings for non-.NET languages: certain Azure database types are backed up along with the app *only* if you configure a connection string for the database in your App Service app.
4849
4950
Adding and editing connection strings follow the same principles as other app settings and they can also be tied to deployment slots. An example of connection strings in JSON formatting that you would use for bulk adding or editing:
5051

@@ -67,7 +68,22 @@ Adding and editing connection strings follow the same principles as other app se
6768
```
6869

6970
> [!NOTE]
70-
> .NET apps targeting PostgreSQL should set the connection string to **Custom** as workaround for a known issue in .NET EnvironmentVariablesConfigurationProvider.
71+
> .NET apps targeting PostgreSQL should set the connection string to **Custom** as work around for a known issue in .NET `EnvironmentVariablesConfigurationProvider`.
72+
73+
At runtime, connection strings are available as environment variables, prefixed with the following connection types:
74+
75+
* SQLServer: `SQLCONNSTR_`
76+
* MySQL: `MYSQLCONNSTR_`
77+
* SQLAzure: `SQLAZURECONNSTR_`
78+
* Custom: `CUSTOMCONNSTR_`
79+
* PostgreSQL: `POSTGRESQLCONNSTR_`
80+
* Notification Hub: `NOTIFICATIONHUBCONNSTR_`
81+
* Service Bus: `SERVICEBUSCONNSTR_`
82+
* Event Hub: `EVENTHUBCONNSTR_`
83+
* Document DB: `DOCDBCONNSTR_`
84+
* Redis Cache: `REDISCACHECONNSTR_`
85+
86+
For example, a MySQL connection string named *connectionstring1* can be accessed as the environment variable `MYSQLCONNSTR_connectionString1`.
7187

7288
## Configure environment variables for custom containers
7389

learn-pr/wwl-azure/configure-web-app-settings/includes/3-configure-general-settings.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ A list of the currently available settings:
1717
* **HTTP version**: Set to **2.0** to enable support for HTTPS/2 protocol.
1818

1919
> [!NOTE]
20-
> Most modern browsers support HTTP/2 protocol over TLS only, while non-encrypted traffic continues to use HTTP/1.1. To ensure that client browsers connect to your app with HTTP/2, secure your custom DNS name.
20+
> Most modern browsers support HTTP/2 protocol over TLS only, while nonencrypted traffic continues to use HTTP/1.1. To ensure that client browsers connect to your app with HTTP/2, secure your custom DNS name.
2121
2222
* **Web sockets**: For ASP.NET SignalR or socket.io, for example.
2323

0 commit comments

Comments
 (0)