Skip to content

Commit e01ce74

Browse files
committed
Update use-variant-feature-flags-python.md
1 parent 40dfc8b commit e01ce74

File tree

1 file changed

+27
-2
lines changed

1 file changed

+27
-2
lines changed

articles/azure-app-configuration/use-variant-feature-flags-python.md

Lines changed: 27 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ In this example, you create a Python Flask web app named _Quote of the Day_. Whe
7272
from azure.appconfiguration.provider import load
7373
from featuremanagement import FeatureManager
7474
from featuremanagement.azuremonitor import publish_telemetry
75+
from azure.identity import DefaultAzureCredential
7576
from opentelemetry import trace
7677
from opentelemetry.trace import get_tracer_provider
7778
from flask_bcrypt import Bcrypt
@@ -86,14 +87,15 @@ In this example, you create a Python Flask web app named _Quote of the Day_. Whe
8687
8788
tracer = trace.get_tracer(__name__, tracer_provider=get_tracer_provider())
8889
89-
CONNECTION_STRING = os.getenv("AzureAppConfigurationConnectionString")
90+
ENDPOINT = os.getenv("AzureAppConfigurationEndpoint")
9091
9192
def callback():
9293
app.config.update(azure_app_config)
9394
9495
global azure_app_config
9596
azure_app_config = load(
96-
connection_string=CONNECTION_STRING,
97+
endpoint=ENDPOINT,
98+
credential=DefaultAzureCredential(),
9799
on_refresh_success=callback,
98100
feature_flag_enabled=True,
99101
feature_flag_refresh_enabled=True,
@@ -514,6 +516,29 @@ In this example, you create a Python Flask web app named _Quote of the Day_. Whe
514516
515517
### Build and run the app (preview)
516518
519+
1. Set an environment variable.
520+
521+
### [Microsoft Entra ID (recommended)](#tab/entra-id)
522+
Set the environment variable named **Endpoint** to the endpoint of your App Configuration store found under the *Overview* of your store in the Azure portal.
523+
524+
If you use the Windows command prompt, run the following command and restart the command prompt to allow the change to take effect:
525+
526+
```cmd
527+
setx AzureAppConfigurationEndpoint "endpoint-of-your-app-configuration-store"
528+
```
529+
530+
If you use PowerShell, run the following command:
531+
532+
```powershell
533+
$Env:AzureAppConfigurationEndpoint = "endpoint-of-your-app-configuration-store"
534+
```
535+
536+
If you use macOS or Linux, run the following command:
537+
538+
```bash
539+
export AzureAppConfigurationEndpoint='endpoint-of-your-app-configuration-store'
540+
```
541+
517542
1. In the command prompt, in the *QuoteOfTheDay* folder, run: `flask run`.
518543
1. Wait for the app to start, and then open a browser and navigate to `http://localhost:5000/`.
519544
1. Once viewing the running application, select **Register** at the top right to register a new user.

0 commit comments

Comments
 (0)