|
2 | 2 | title: Quickstart for using Azure App Configuration with Python apps | Microsoft Learn
|
3 | 3 | description: In this quickstart, create a Python app with the Azure App Configuration to centralize storage and management of application settings separate from your code.
|
4 | 4 | services: azure-app-configuration
|
5 |
| -author: maud-lv |
| 5 | +author: mrm9084 |
6 | 6 | ms.service: azure-app-configuration
|
7 | 7 | ms.devlang: python
|
8 | 8 | ms.topic: quickstart
|
9 | 9 | ms.custom: devx-track-python, mode-other, engagement-fy23
|
10 |
| -ms.date: 11/20/2023 |
11 |
| -ms.author: malev |
| 10 | +ms.date: 12/03/2024 |
| 11 | +ms.author: mametcal |
12 | 12 | #Customer intent: As a Python developer, I want to manage all my app settings in one place.
|
13 | 13 | ---
|
14 | 14 | # Quickstart: Create a Python app with Azure App Configuration
|
@@ -126,76 +126,52 @@ In this section, you will create a console application and load data from your A
|
126 | 126 | print("message found: " + str("message" in config))
|
127 | 127 | print("test.message found: " + str("test.message" in config))
|
128 | 128 | ```
|
| 129 | + --- |
129 | 130 |
|
130 | 131 | ### Run the application
|
131 | 132 |
|
132 |
| -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: |
133 |
| - |
134 |
| - #### [Windows command prompt](#tab/windowscommandprompt) |
| 133 | + ### [Microsoft Entra ID (recommended)](#tab/entra-id) |
| 134 | + 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. |
135 | 135 |
|
136 |
| - 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: |
| 136 | + If you use the Windows command prompt, run the following command and restart the command prompt to allow the change to take effect: |
137 | 137 |
|
138 | 138 | ```cmd
|
139 |
| - setx AZURE_APPCONFIG_CONNECTION_STRING "connection-string-of-your-app-configuration-store" |
| 139 | + setx AZURE_APPCONFIG_ENDPOINT "endpoint-of-your-app-configuration-store" |
140 | 140 | ```
|
141 | 141 |
|
142 |
| - #### [PowerShell](#tab/powershell) |
| 142 | + If you use PowerShell, run the following command: |
143 | 143 |
|
144 |
| - 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: |
145 |
| - |
146 |
| - ```azurepowershell |
147 |
| - $Env:AZURE_APPCONFIG_CONNECTION_STRING = "<app-configuration-store-connection-string>" |
| 144 | + ```powershell |
| 145 | + $Env:AZURE_APPCONFIG_ENDPOINT = "endpoint-of-your-app-configuration-store" |
148 | 146 | ```
|
149 | 147 |
|
150 |
| - #### [macOS](#tab/unix) |
151 |
| - |
152 |
| - If you use macOS, run the following command and replace `<app-configuration-store-connection-string>` with the connection string of your app configuration store: |
| 148 | + If you use macOS or Linux, run the following command: |
153 | 149 |
|
154 |
| - ```console |
155 |
| - export AZURE_APPCONFIG_CONNECTION_STRING='<app-configuration-store-connection-string>' |
156 |
| - ``` |
157 |
| - |
158 |
| - #### [Linux](#tab/linux) |
159 |
| - |
160 |
| - If you use Linux, run the following command and replace `<app-configuration-store-connection-string>` with the connection string of your app configuration store: |
161 |
| - |
162 |
| - ```console |
163 |
| - export AZURE_APPCONFIG_CONNECTION_STRING='<app-configuration-store-connection-string>' |
| 150 | + ```bash |
| 151 | + export AZURE_APPCONFIG_ENDPOINT='endpoint-of-your-app-configuration-store' |
164 | 152 | ```
|
165 | 153 |
|
166 |
| -1. Print out the value of the environment variable to validate that it is set properly with the command below. |
167 |
| - |
168 |
| - #### [Windows command prompt](#tab/windowscommandprompt) |
| 154 | + ### [Connection string](#tab/connection-string) |
| 155 | + 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. |
169 | 156 |
|
170 |
| - Using the Windows command prompt, restart the command prompt to allow the change to take effect and run the following command: |
| 157 | + If you use the Windows command prompt, run the following command and restart the command prompt to allow the change to take effect: |
171 | 158 |
|
172 | 159 | ```cmd
|
173 |
| - echo %AZURE_APPCONFIG_CONNECTION_STRING% |
174 |
| - ``` |
175 |
| - |
176 |
| - #### [PowerShell](#tab/powershell) |
177 |
| - |
178 |
| - If you use Windows PowerShell, run the following command: |
179 |
| - |
180 |
| - ```azurepowershell |
181 |
| - $Env:AZURE_APPCONFIG_CONNECTION_STRING |
| 160 | + setx AZURE_APPCONFIG_CONNECTION_STRING "connection-string-of-your-app-configuration-store" |
182 | 161 | ```
|
183 | 162 |
|
184 |
| - #### [macOS](#tab/unix) |
185 |
| - |
186 |
| - If you use macOS, run the following command: |
| 163 | + If you use PowerShell, run the following command: |
187 | 164 |
|
188 |
| - ```console |
189 |
| - echo "$AZURE_APPCONFIG_CONNECTION_STRING" |
| 165 | + ```powershell |
| 166 | + $Env:AZURE_APPCONFIG_CONNECTION_STRING = "connection-string-of-your-app-configuration-store" |
190 | 167 | ```
|
191 | 168 |
|
192 |
| - #### [Linux](#tab/linux) |
| 169 | + If you use macOS or Linux, run the following command: |
193 | 170 |
|
194 |
| - If you use Linux, run the following command: |
195 |
| - |
196 |
| - ```console |
197 |
| - echo "$AZURE_APPCONFIG_CONNECTION_STRING" |
| 171 | + ```bash |
| 172 | + export AZURE_APPCONFIG_CONNECTION_STRING='connection-string-of-your-app-configuration-store' |
198 | 173 | ```
|
| 174 | + --- |
199 | 175 |
|
200 | 176 | 1. After the environment variable is properly set, run the following command to run the app locally:
|
201 | 177 |
|
|
0 commit comments