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/app-service/app-service-configuration-references.md
+59-9Lines changed: 59 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,7 +4,7 @@ description: Set up Azure App Service and Azure Functions to use App Configurati
4
4
author: muksvso
5
5
6
6
ms.topic: how-to
7
-
ms.date: 05/08/2025
7
+
ms.date: 03/30/2026
8
8
ms.author: mubatra
9
9
10
10
#customer intent: As a developer, I want to use Azure App Configuration references so that I can make configuration key/value pairs available to code.
@@ -17,6 +17,20 @@ ms.custom: sfi-ropc-nochange
17
17
18
18
This article shows how to work with configuration data in Azure App Service or Azure Functions applications without making any code changes. [Azure App Configuration](../azure-app-configuration/overview.md) is an Azure service that you can use to centrally manage application configuration. It's also an effective tool for auditing your configuration values over time or across releases.
19
19
20
+
## Important notes for Azure Functions local development
21
+
22
+
App Configuration references (`@Microsoft.AppConfiguration(...)`) are resolved by the Azure App Service/Functions platform when your app runs in Azure.
23
+
24
+
-**Azure (supported):** Put the reference in your function app's **Application settings** (for example, in the Azure portal, ARM/Bicep, or other deployment tooling).
25
+
-**Local (not supported):** The Functions host running on your development machine doesn't resolve `@Microsoft.AppConfiguration(...)` values from *local.settings.json*.
26
+
-**User secrets (not supported):** The Functions user secrets store (*secrets.json*) is also not processed for `@Microsoft.AppConfiguration(...)` references.
27
+
-**SDK code (not required for this feature):** Calling `AddAzureAppConfiguration()` configures the App Configuration SDK for in-process resolution, but it doesn't make the platform resolve `@Microsoft.AppConfiguration(...)` references locally.
28
+
29
+
If you want the same configuration values locally, use one of the following approaches:
30
+
31
+
- Add the values directly to *local.settings.json* (for example, set `MySetting` to the literal value you want locally).
32
+
- Use the App Configuration SDK in your app code (for example, by configuring `AddAzureAppConfiguration()` and connecting to your store with a connection string or credentials appropriate for local dev). This approach is separate from platform references.
33
+
20
34
## Grant app access to App Configuration
21
35
22
36
To get started with using App Configuration references in App Service, first you create an App Configuration store. You then grant permissions to your app to access the configuration key/value pairs that are in the store.
@@ -78,20 +92,58 @@ An App Configuration reference has the form `@Microsoft.AppConfiguration({refere
78
92
Here's an example of a complete reference that includes `Label`:
Any configuration change to the app that results in a site restart causes an immediate refetch of all referenced key/value pairs from the App Configuration store.
91
105
92
106
> [!NOTE]
93
107
> Automatic refresh and refetch of these values when the key/value pairs are updated in App Configuration isn't currently supported.
94
108
109
+
## Working example (Azure Functions)
110
+
111
+
The following example shows where the `@Microsoft.AppConfiguration(...)` syntax goes for an Azure Functions app.
112
+
113
+
### 1) Create a key/value in App Configuration
114
+
115
+
In your App Configuration store, create a key/value pair:
116
+
117
+
-**Key:**`Demo:Color`
118
+
-**Label:** (optional) `dev`
119
+
-**Value:**`Blue`
120
+
121
+
### 2) Add an application setting to your function app in Azure
122
+
123
+
In your Function App (in Azure), add an application setting named `Demo__Color` and set its value to an App Configuration reference.
124
+
125
+
> [!NOTE]
126
+
> Use double underscores (`__`) if you want .NET configuration binding to map to `Demo:Color`.
At runtime, your code reads `Demo:Color` like any other app setting.
143
+
144
+
> [!TIP]
145
+
> You don't need to call `AddAzureAppConfiguration()` for platform references. Use `AddAzureAppConfiguration()` only when you want to load configuration directly via the SDK.
146
+
95
147
## Source application settings from App Configuration
96
148
97
149
You can use App Configuration references as values for [application settings](configure-common.md#configure-app-settings) so you can keep configuration data in App Configuration instead of in the site configuration settings. Application settings and App Configuration key/value pairs are both securely encrypted at rest. If you need centralized configuration management capabilities, add configuration data to App Configuration.
@@ -162,8 +214,8 @@ Here's a sample template for a function app that has App Configuration reference
0 commit comments