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
title: 'Tutorial: Use variant feature flags from Azure App Configuration in a Python application (preview)'
2
+
title: 'Use variant feature flags application'
3
3
titleSuffix: Azure App configuration
4
4
description: In this tutorial, you learn how to use variant feature flags in an Python application
5
5
#customerintent: As a user of Azure App Configuration, I want to learn how I can use variants and variant feature flags in my python application.
6
6
author: mrm9084
7
7
ms.author: mametcal
8
8
ms.service: azure-app-configuration
9
9
ms.devlang: python
10
-
ms.topic: tutorial
10
+
ms.topic: how-to
11
11
ms.date: 12/02/2024
12
12
---
13
13
14
-
# Tutorial: Use variant feature flags in Azure App Configuration (preview)
14
+
# Tutorial: Use variant feature flags in Azure App Configuration
15
15
16
16
In this tutorial, you use a variant feature flag to manage experiences for different user segments in an example application, *Quote of the Day*. You utilize the variant feature flag created in [Use variant feature flags](./use-variant-feature-flags.md). Before proceeding, ensure you create the variant feature flag named *Greeting* in your App Configuration store.
17
17
@@ -36,25 +36,19 @@ In this tutorial, you use a variant feature flag to manage experiences for diffe
36
36
.\venv\Scripts\Activate
37
37
```
38
38
39
-
1. Install the required packages. The latest preview versions of `azure-appconfiguration-provider`, and `featuremanagement` are required for variant feature flags (preview).
39
+
1. Install the required packages. The latest preview versions of `azure-appconfiguration-provider`, and `featuremanagement` are required for variant feature flags.
1. Create a new file named *app.py*in the *QuoteOfTheDay* folder.
46
-
47
-
### [Microsoft Entra ID (recommended)](#tab/entra-id)
48
-
You use the `DefaultAzureCredential` to authenticate to your App Configuration store. Follow the [instructions](./concept-enable-rbac.md#authentication-with-token-credentials) to assign your credential the **App Configuration Data Reader** role. Be sure to allow sufficient timefor the permission to propagate before running your application.
45
+
1. Create a new file named *app.py*in the *QuoteOfTheDay* folder. You use the `DefaultAzureCredential` to authenticate to your App Configuration store. Follow the [instructions](./concept-enable-rbac.md#authentication-with-token-credentials) to assign your credential the **App Configuration Data Reader** role. Be sure to allow sufficient timefor the permission to propagate before running your application.
49
46
50
47
```python
51
48
import os
52
49
from azure.appconfiguration.provider import load
53
50
from featuremanagement import FeatureManager
54
-
from featuremanagement.azuremonitor import publish_telemetry
55
51
from azure.identity import DefaultAzureCredential
56
-
from opentelemetry import trace
57
-
from opentelemetry.trace import get_tracer_provider
58
52
from flask_bcrypt import Bcrypt
59
53
60
54
from flask_sqlalchemy import SQLAlchemy
@@ -65,8 +59,6 @@ In this tutorial, you use a variant feature flag to manage experiences for diffe
@@ -443,21 +360,11 @@ In this tutorial, you use a variant feature flag to manage experiences for diffe
443
360
{% endblock %}
444
361
```
445
362
446
-
1. Create a new file named *privacy.html*in the *templates* folder.
447
-
448
-
```html
449
-
{% extends 'base.html' %}
450
-
451
-
{% block content %}
452
-
<p>Use this page to detail your site's privacy policy.</p>
453
-
{% endblock %}
454
-
```
455
-
456
363
1. Create a new folder named *static*in the *QuoteOfTheDay* folder.
457
364
458
365
1. Create a new folder named *css*in the *static* folder.
459
366
460
-
1. Create a new file named *site.css* in the *static* folder.
367
+
1. Create a new file named *site.css*in the *css* folder.
461
368
462
369
```css
463
370
html {
@@ -549,12 +456,9 @@ In this tutorial, you use a variant feature flag to manage experiences for diffe
549
456
}
550
457
```
551
458
552
-
### Build and run the app (preview)
553
-
554
-
1. Set an environment variable.
459
+
### Build and run the app
555
460
556
-
### [Microsoft Entra ID (recommended)](#tab/entra-id)
557
-
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.
461
+
1. Set an environment variable. 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.
558
462
559
463
If you use the Windows command prompt, run the following command and restart the command prompt to allow the change to take effect:
560
464
@@ -574,28 +478,6 @@ In this tutorial, you use a variant feature flag to manage experiences for diffe
Set the environment variable named **ConnectionString** to the read-only connection string of your App Configuration store found under *Access keys* of your store in the Azure portal.
579
-
580
-
If you use the Windows command prompt, run the following command and restart the command prompt to allow the change to take effect:
0 commit comments