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/tutorial-python-postgresql-app.md
+23-4Lines changed: 23 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -154,7 +154,7 @@ Sign in to the [Azure portal](https://portal.azure.com/) and follow these steps
154
154
155
155
## 2. Verify connection settings
156
156
157
-
The creation wizard generated the connectivity variables for you already as [app settings](configure-common.md#configure-app-settings).
157
+
The creation wizard generated the connectivity variables for you already as [app settings](configure-common.md#configure-app-settings). App settings are one way to keep connection secrets out of your code repository. When you're ready to move your secrets to a more secure location, here's an [article on storing in Azure Key Vault](../key-vault/certificates/quick-create-python.md).
158
158
159
159
:::row:::
160
160
:::column span="2":::
@@ -167,14 +167,33 @@ The creation wizard generated the connectivity variables for you already as [app
167
167
:::row:::
168
168
:::column span="2":::
169
169
**Step 2.** In the **Application settings** tab of the **Configuration** page, verify that `AZURE_POSTGRESQL_CONNECTIONSTRING` is present. That will be injected into the runtime environment as an environment variable.
170
-
App settings are one way to keep connection secrets out of your code repository.
171
-
When you're ready to move your secrets to a more secure location,
172
-
here's an [article on storing in Azure Key Vault](../key-vault/certificates/quick-create-python.md).
173
170
:::column-end:::
174
171
:::column:::
175
172
:::image type="content" source="./media/tutorial-python-postgresql-app/azure-portal-get-connection-string-2.png" alt-text="A screenshot showing how to see the autogenerated connection string." lightbox="./media/tutorial-python-postgresql-app/azure-portal-get-connection-string-2.png":::
176
173
:::column-end:::
174
+
:::row:::
175
+
:::column span="2":::
176
+
**Step 3.** In a terminal or command prompt, run the following Python script to generate a unique secret: `python -c 'import secrets; print(secrets.token_hex())'`. Copy the output value to use in the next step.
177
+
:::column-end:::
178
+
:::column:::
179
+
:::column-end:::
177
180
:::row-end:::
181
+
:::row:::
182
+
:::column span="2":::
183
+
**Step 4.** In the **Application settings** tab of the **Configuration** page, select **New application setting**. Name the setting `SECRET_KEY`. Paste the value from the previous value. Select **OK**.
184
+
:::column-end:::
185
+
:::column:::
186
+
:::image type="content" source="./media/tutorial-python-postgresql-app/azure-portal-app-service-app-setting.png" alt-text="A screenshot showing how to set the SECRET_KEY app setting in the Azure portal." lightbox="./media/tutorial-python-postgresql-app/azure-portal-app-service-app-setting.png":::
187
+
:::column-end:::
188
+
:::row:::
189
+
:::column span="2":::
190
+
**Step 5.** Select **Save**.
191
+
:::column-end:::
192
+
:::column:::
193
+
:::image type="content" source="./media/tutorial-python-postgresql-app/azure-portal-app-service-app-setting-save.png" alt-text="A screenshot showing how to save the SECRET_KEY app setting in the Azure portal." lightbox="./media/tutorial-python-postgresql-app/azure-portal-app-service-app-setting-save.png":::
194
+
:::column-end:::
195
+
:::row-end:::
196
+
178
197
179
198
Having issues? Check the [Troubleshooting guide](configure-language-python.md#troubleshooting).
0 commit comments