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/quickstart-python.md
+22-8Lines changed: 22 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -219,20 +219,18 @@ Having issues? Refer first to the [Troubleshooting guide](./configure-language-p
219
219
220
220
Based on the presence of certain files in your deployment, App Service automatically detects whether your app is a Django or Flask app and performs default steps to run your app. For apps based on other web frameworks like FastAPI, you need to configure a startup script for App Service to run your app; otherwise, App Service runs a default read-only app located in the *opt/defaultsite* folder. For details on how App Service runs Python apps, see [Configure a Linux Python app for Azure App Service](configure-language-python.md).
221
221
222
-
### [Flask](#tab/flask)
222
+
### [Azure CLI](#tab/azure-cli/flask)
223
223
224
224
App Service automatically detects the presence of a Flask app. No additional configuration is needed.
225
225
226
-
### [Django](#tab/django)
226
+
### [Azure CLI](#tab/azure-cli/django)
227
227
228
228
App Service automatically detects the presence of a Django app. No additional configuration is needed.
229
229
230
-
### [FastAPI](#tab/fastapi)
230
+
### [Azure CLI](#tab/azure-cli/fastapi)
231
231
232
232
For FastAPI, you must configure a custom startup command for App Service to run your app.
233
233
234
-
#### [Azure CLI](#tab/azure-cli/fastapi)
235
-
236
234
First, configure the startup command using the [az webapp config set](/cli/azure/webapp/config#az-webapp-config-set) command.
237
235
238
236
```azurecli
@@ -250,20 +248,36 @@ az webapp restart \
250
248
--resource-group $RESOURCE_GROUP_NAME
251
249
```
252
250
253
-
#### [VS Code](#tab/vscode-aztools/fastapi)
251
+
### [VS Code](#tab/vscode-aztools/flask)
252
+
253
+
App Service automatically detects the presence of a Flask app. No additional configuration is needed.
254
+
255
+
### [VS Code](#tab/vscode-aztools/django)
256
+
257
+
App Service automatically detects the presence of a Django app. No additional configuration is needed.
258
+
259
+
### [VS Code](#tab/vscode-aztools/fastapi)
254
260
255
261
Use Azure CLI or the Azure portal to configure the startup command.
256
262
263
+
### [Azure portal](#tab/azure-portal/flask)
264
+
265
+
App Service automatically detects the presence of a Flask app. No additional configuration is needed.
266
+
267
+
### [Azure portal](#tab/azure-portal/django)
268
+
269
+
App Service automatically detects the presence of a Django app. No additional configuration is needed.
270
+
257
271
#### [Azure portal](#tab/azure-portal/fastapi)
258
272
273
+
For FastAPI, you must configure a custom startup command for App Service to run your app.
274
+
259
275
First, configure the startup command. Under **Settings**, on the left menu, select the app's **Configuration** page, then select **General settings**. In the **Startup Command** field, enter *python main.py*. Then select **Save** to apply the changes. Wait for the notification that the settings have been updated before proceeding.
260
276
261
277
Next, restart the web app. Select the app's **Overview** page on the left menu. On the top menu, select **Restart**.
262
278
263
279
---
264
280
265
-
---
266
-
267
281
## 5 - Browse to the app
268
282
269
283
Browse to the deployed application in your web browser at the URL `http://<app-name>.azurewebsites.net`. If you see a default app page, wait a minute and refresh the browser.
0 commit comments