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
#Customer intent: As a Python developer, I want to use the Azure SDK for Python to access my data in Azure App Configuration.
13
13
---
@@ -70,75 +70,52 @@ Add the following key-value to the App Configuration store and leave **Label** a
70
70
> [!NOTE]
71
71
> The code snippets in this example will help you get started with the App Configuration client library for Python. For your application, you should also consider handling exceptions according to your needs. To learn more about exception handling, please refer to our [Python SDK documentation](https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/appconfiguration/azure-appconfiguration).
72
72
73
-
## Configure your App Configuration connection string
73
+
## Configure an environment variable.
74
74
75
-
1. Set an environment variable named **AZURE_APPCONFIG_CONNECTION_STRING**, and set it to the connection string of your App Configuration store. At the command line, run the following command:
75
+
### [Microsoft Entra ID (recommended)](#tab/entra-id)
Set the environment variable named **AZURE_APPCONFIG_ENDPOINT** to the endpoint of your App Configuration store found under the *Overview* of your store in the Azure portal.
78
78
79
-
To run the app locally using the Windows command prompt, run the following command and replace `<app-configuration-store-connection-string>` with the connection string of your app configuration store:
79
+
If you use the Windows command prompt, run the following command and restart the command prompt to allow the change to take effect:
If you use Windows PowerShell, run the following command and replace `<app-configuration-store-connection-string>` with the connection string of your app configuration store:
If you use macOS, run the following command and replace `<app-configuration-store-connection-string>` with the connection string of your app configuration store:
If you use Linux, run the following command and replace `<app-configuration-store-connection-string>` with the connection string of your app configuration store:
If you use Windows PowerShell, run the following command:
97
+
### [Connection string](#tab/connection-string)
122
98
123
-
```azurepowershell
124
-
$Env:AZURE_APPCONFIG_CONNECTION_STRING
125
-
```
99
+
Set the environment variable named **AZURE_APPCONFIG_CONNECTION_STRING** to the read-only connection string of your App Configuration store found under *Access keys* of your store in the Azure portal.
126
100
127
-
### [macOS](#tab/unix)
101
+
If you use the Windows command prompt, run the following command and restart the command prompt to allow the change to take effect:
from azure.appconfiguration import AzureAppConfigurationClient, ConfigurationSetting
@@ -297,6 +343,8 @@ except Exception as ex:
297
343
print(ex)
298
344
```
299
345
346
+
---
347
+
300
348
In your console window, navigate to the directory containing the *app-configuration-example.py* file and execute the following Python command to run the app:
0 commit comments