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-fastapi.md
+12-10Lines changed: 12 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,7 +3,7 @@ title: 'Tutorial: Deploy a Python FastAPI web app with PostgreSQL'
3
3
description: Create a FastAPI web app with a PostgreSQL database and deploy it to Azure. The tutorial uses the FastAPI framework and the app is hosted on Azure App Service on Linux.
@@ -398,7 +398,7 @@ In this step, you create the Azure resources and deploy a sample app to App Serv
398
398
azd up
399
399
```
400
400
401
-
The `azd up`commandmight take a few minutes to complete. It also compiles and deploys your application code. While it's running, the command provides messages about the provisioning and deployment process, including a link to the deployment in Azure. When it finishes, the command also displays a link to the deploy application.
401
+
The `azd up`commandcan take a several minutes to complete. It also compiles and deploys your application code. While it's running, the command provides messages about the provisioning and deployment process, including a link to the deployment in Azure. When it finishes, the command also displays a link to the deploy application.
402
402
403
403
This azd template contains files (*azure.yaml* and the *infra* directory) that generate a secure-by-default architecture with the following Azure resources:
404
404
@@ -410,6 +410,8 @@ In this step, you create the Azure resources and deploy a sample app to App Serv
410
410
- **Private DNS zone** → Enables DNS resolution of the PostgreSQL server in the virtual network.
411
411
- **Log Analytics workspace** → Acts as the target container for your app to ship its logs, where you can also query the logs.
412
412
413
+
Note down the values for the **Subscription ID** (Guid), the **App Service**, and the **Resource Group** in the output. You'll use them in the following sections.
414
+
413
415
## 2. Examine the database connection string
414
416
415
417
The azd template generates the connectivity variables for you as [app settings](configure-common.md#configure-app-settings). App settings are one way to keep connection secrets out of your code repository.
@@ -442,11 +444,11 @@ You may have noticed in the previous section that *entrypoint.sh* contains the f
442
444
443
445
In this section, you'll run this command manually fordemonstration purposes. With the PostgreSQL database protected by the virtual network, the easiest way to run the command isin an SSH session with the App Service container.
444
446
445
-
1. In the azd output, find the URL for the SSH session and navigate to it in the browser. It looks like this in the output:
447
+
1. Use the value of the **App Service** that you noted previously in the azd output and the template shown below, to construct the URL forthe SSH session and navigate to itin the browser:
446
448
447
-
<pre>
448
-
Open SSH session to App Service container at: https://<app-name>.scm.azurewebsites.net/webssh/host
1. In the SSH terminal, run `python3 src/fastapi_app/seed_data.py`. If it succeeds, App Service is [connecting successfully to the database](#i-get-an-error-when-running-database-migrations).
452
454
@@ -481,11 +483,11 @@ The sample app uses the Python Standard Library logging module to output logs. T
In the azd output, find the link to stream App Service logs and navigate to it in the browser. The link looks like this in the azd output:
486
+
Use the values of the **Subscription ID** (Guid), **Resource Group**, and **App Service** that you noted previously in the azd output and the template shown below, to construct the URL to stream App Service logs and navigate to it in the browser.
485
487
486
-
<pre>
487
-
Stream App Service logs at: https://portal.azure.com/#@/resource/subscriptions/<subscription-guid>/resourceGroups/<group-name>/providers/Microsoft.Web/sites/<app-name>/logStream
Learn more about logging in Python apps in the series on [setting up Azure Monitor for your Python application](/azure/azure-monitor/app/opencensus-python).
0 commit comments