Skip to content

Commit 5ba5f22

Browse files
committed
Have users create URLs rather than read them from output since these values are not emitted by our template
1 parent 1125cfd commit 5ba5f22

File tree

1 file changed

+12
-10
lines changed

1 file changed

+12
-10
lines changed

articles/app-service/tutorial-python-postgresql-app-fastapi.md

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ title: 'Tutorial: Deploy a Python FastAPI web app with PostgreSQL'
33
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.
44
ms.devlang: python
55
ms.topic: tutorial
6-
ms.date: 7/19/2024
6+
ms.date: 7/24/2024
77
ms.author: msangapu
88
author: msangapu-msft
99
ms.custom: mvc, cli-validate, devx-track-python, devdivchpfy22, vscode-azure-extension-update-completed, AppServiceConnectivity, devx-track-extended-azdevcli, linux-related-content
@@ -398,7 +398,7 @@ In this step, you create the Azure resources and deploy a sample app to App Serv
398398
azd up
399399
```
400400

401-
The `azd up` command might 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` command can 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.
402402
403403
This azd template contains files (*azure.yaml* and the *infra* directory) that generate a secure-by-default architecture with the following Azure resources:
404404
@@ -410,6 +410,8 @@ In this step, you create the Azure resources and deploy a sample app to App Serv
410410
- **Private DNS zone** → Enables DNS resolution of the PostgreSQL server in the virtual network.
411411
- **Log Analytics workspace** → Acts as the target container for your app to ship its logs, where you can also query the logs.
412412
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+
413415
## 2. Examine the database connection string
414416

415417
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
442444
443445
In this section, you'll run this command manually for demonstration purposes. With the PostgreSQL database protected by the virtual network, the easiest way to run the command is in an SSH session with the App Service container.
444446

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 for the SSH session and navigate to it in the browser:
446448

447-
<pre>
448-
Open SSH session to App Service container at: https://&lt;app-name>.scm.azurewebsites.net/webssh/host
449-
</pre>
449+
```
450+
https://<app-name>.scm.azurewebsites.net/webssh/host
451+
```
450452

451453
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).
452454

@@ -481,11 +483,11 @@ The sample app uses the Python Standard Library logging module to output logs. T
481483

482484
:::code language="python" source="~/msdocs-fastapi-postgresql-sample-app/src/fastapi_app/app.py" range="39-46" highlight="3":::
483485

484-
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.
485487

486-
<pre>
487-
Stream App Service logs at: https://portal.azure.com/#@/resource/subscriptions/&lt;subscription-guid>/resourceGroups/&lt;group-name>/providers/Microsoft.Web/sites/&lt;app-name>/logStream
488-
</pre>
488+
```
489+
https://portal.azure.com/#@/resource/subscriptions/<subscription-guid>/resourceGroups/<group-name>/providers/Microsoft.Web/sites/<app-name>/logStream
490+
```
489491

490492
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).
491493

0 commit comments

Comments
 (0)