Skip to content

Commit a42dc54

Browse files
committed
fix formatting issues
1 parent 0c84908 commit a42dc54

File tree

2 files changed

+35
-34
lines changed

2 files changed

+35
-34
lines changed

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

Lines changed: 20 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,7 @@ The creation wizard generated the connectivity variables for you already as [app
261261
**Step 7: Configure the Redis connector to use Key Vault secrets**
262262
1. In the Service Connectors page, select the checkbox next to the Cache for Redis connector, then select **Edit**.
263263
1. Select the **Authentication** tab.
264-
1. Select **Store Secret in Key Vault**.
264+
1. Select **Store Secret in Key Vault**.
265265
1. Under **Key Vault Connection**, select the key vault you created.
266266
1. Select **Next: Networking**.
267267
1. Select **Configure firewall rules to enable access to target service**. The app creation wizard already secured the SQL database with a private endpoint.
@@ -359,7 +359,7 @@ In this step, you'll configure GitHub deployment using GitHub Actions. It's just
359359
GitHub Copilot doesn't give you the same response every time, and it's not always correct. You might need to ask more questions to fine-tune its response. For tips, see [What can I do with GitHub Copilot in my codespace?](#what-can-i-do-with-github-copilot-in-my-codespace).
360360
:::column-end:::
361361
:::column:::
362-
:::image type="content" source="media/tutorial-python-postgresql-app-flask/github-copilot-1.png" alt-text="A screenshot showing how to ask a question in a new GitHub Copilot chat session." lightbox="media/tutorial-python-postgresql-app-django/github-flask-1.png":::
362+
:::image type="content" source="media/tutorial-python-postgresql-app-flask/github-copilot-1.png" alt-text="A screenshot showing how to ask a question in a new GitHub Copilot chat session." lightbox="media/tutorial-python-postgresql-app-django/github-copilot-1.png":::
363363
:::column-end:::
364364
:::row-end:::
365365
:::row:::
@@ -409,7 +409,7 @@ Having issues? Check the [Troubleshooting guide](configure-language-python.md#tr
409409

410410
## 4. Generate database schema
411411

412-
With the PostgreSQL database protected by the virtual network, the easiest way to run [Django database migrations](https://docs.djangoproject.com/en/4.1/topics/migrations/) is in an SSH session with the App Service container.
412+
With the PostgreSQL database protected by the virtual network, the easiest way to run [Django database migrations](https://docs.djangoproject.com/en/4.1/topics/migrations/) is in an SSH session with the Linux container in App Service.
413413

414414
:::row:::
415415
:::column span="2":::
@@ -423,7 +423,7 @@ With the PostgreSQL database protected by the virtual network, the easiest way t
423423
:::row-end:::
424424
:::row:::
425425
:::column span="2":::
426-
**Step 2:** In the SSH terminal, run `python manage.py migrate`. If it succeeds, App Service is [connecting successfully to the database](#i-get-an-error-when-running-database-migrations).
426+
**Step 2:** In the SSH session, run `python manage.py migrate`. If it succeeds, App Service is [connecting successfully to the database](#i-get-an-error-when-running-database-migrations).
427427
:::column-end:::
428428
:::column:::
429429
:::image type="content" source="./media/tutorial-python-postgresql-app-django/azure-portal-generate-db-schema-django-2.png" alt-text="A screenshot showing the commands to run in the SSH shell and their output (Django)." lightbox="./media/tutorial-python-postgresql-app-django/azure-portal-generate-db-schema-django-2.png":::
@@ -577,17 +577,17 @@ Having issues? Check the [Troubleshooting section](#troubleshooting).
577577
578578
The AZD template you use generated the connectivity variables for you already as [app settings](configure-common.md#configure-app-settings) and outputs the them to the terminal for your convenience. App settings are one way to keep connection secrets out of your code repository.
579579
580-
1. In the AZD output, find the app settings and find the settings `AZURE_POSTGRESQL_USER`, `AZURE_POSTGRESQL_PASSWORD`, `AZURE_POSTGRESQL_HOST`, `AZURE_POSTGRESQL_NAME`, and `AZURE_REDIS_CONNECTIONSTRING`. To keep secrets safe, only the setting names are displayed. They look like this in the azd output:
580+
1. In the AZD output, find the settings `AZURE_POSTGRESQL_USER`, `AZURE_POSTGRESQL_PASSWORD`, `AZURE_POSTGRESQL_HOST`, `AZURE_POSTGRESQL_NAME`, and `AZURE_REDIS_CONNECTIONSTRING`. To keep secrets safe, only the setting names are displayed. They look like this in the AZD output:
581581
582582
<pre>
583-
App Service app has the following connection settings:
584-
- AZURE_POSTGRESQL_NAME
585-
- AZURE_POSTGRESQL_HOST
586-
- AZURE_POSTGRESQL_USER
587-
- AZURE_POSTGRESQL_PASSWORD
588-
- AZURE_REDIS_CONNECTIONSTRING
589-
- AZURE_KEYVAULT_RESOURCEENDPOINT
590-
- AZURE_KEYVAULT_SCOPE
583+
App Service app has the following connection settings:
584+
- AZURE_POSTGRESQL_NAME
585+
- AZURE_POSTGRESQL_HOST
586+
- AZURE_POSTGRESQL_USER
587+
- AZURE_POSTGRESQL_PASSWORD
588+
- AZURE_REDIS_CONNECTIONSTRING
589+
- AZURE_KEYVAULT_RESOURCEENDPOINT
590+
- AZURE_KEYVAULT_SCOPE
591591
</pre>
592592
593593
1. For your convenience, the AZD template shows you the direct link to the app's app settings page. Find the link and open it in a new browser tab.
@@ -616,7 +616,7 @@ Having issues? Check the [Troubleshooting section](#troubleshooting).
616616
617617
# [Without GitHub Copilot](#tab/nocopilot)
618618
619-
1. You need to use the four app settings for connectivity in App service. Open *azureproject/production.py*, uncomment the following lines (lines 3-8), and save the file:
619+
1. You need to use the five app settings for connectivity in App service. Open *azureproject/production.py*, uncomment the following lines (lines 29-48), and save the file:
620620
621621
```python
622622
DATABASE_URI = 'postgresql+psycopg2://{dbuser}:{dbpass}@{dbhost}/{dbname}'.format(
@@ -637,6 +637,7 @@ Having issues? Check the [Troubleshooting section](#troubleshooting).
637637
}
638638
}
639639
```
640+
640641
Your application code is now configured to connect to the PostgreSQL database and Redis cache in Azure.
641642
642643
-----
@@ -648,23 +649,23 @@ Having issues? Check the [Troubleshooting section](#troubleshooting).
648649
```
649650
650651
> [!NOTE]
651-
> If you run `azd up`, it combines `azd package`, `azd provision`, and `azd deploy`. The reason you didn't do it at the beginning was because you didn't have the PostgreSQL connection settings for to modify your code with yet. If you ran `azd up` then, the deploy stage would stall because the Gunicorn server wouldn't be able to start the app without valid connection settings.
652+
> If you run `azd up`, it combines `azd package`, `azd provision`, and `azd deploy`. The reason you didn't do it at the beginning was because you didn't have the PostgreSQL connection settings to modify your code with yet. If you ran `azd up` then, the deploy stage would stall because the Gunicorn server wouldn't be able to start the app without valid connection settings. But in general, you can rerun these commands when you make changes to your AZD template or to your code.
652653

653654
-----
654655

655656
Having issues? Check the [Troubleshooting section](#troubleshooting).
656657

657658
## 5. Generate database schema
658659

659-
With the PostgreSQL database protected by the virtual network, the easiest way to run Django database migrations is in an SSH session with the App Service container.
660+
With the PostgreSQL database protected by the virtual network, the easiest way to run Django database migrations is in an SSH session with the Linux container in App Service.
660661

661-
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:
662+
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:
662663

663664
<pre>
664665
Open SSH session to App Service container at: https://&lt;app-name>.scm.azurewebsites.net/webssh/host
665666
</pre>
666667

667-
1. In the SSH terminal, run `python manage.py migrate`. If it succeeds, App Service is [connecting successfully to the database](#i-get-an-error-when-running-database-migrations).
668+
1. In the SSH session, run `python manage.py migrate`. If it succeeds, App Service is [connecting successfully to the database](#i-get-an-error-when-running-database-migrations).
668669

669670
:::image type="content" source="./media/tutorial-python-postgresql-app-django/azure-portal-generate-db-schema-django-2.png" alt-text="A screenshot showing the commands to run in the SSH shell and their output (Django)." lightbox="./media/tutorial-python-postgresql-app-django/azure-portal-generate-db-schema-django-2.png":::
670671

@@ -767,7 +768,7 @@ Pricing for the created resources is as follows:
767768
768769
#### How do I connect to the PostgreSQL server that's secured behind the virtual network with other tools?
769770
770-
- For basic access from a command-line tool, you can run `psql` from the app's SSH terminal.
771+
- For basic access from a command-line tool, you can run `psql` from the app's SSH session.
771772
- To connect from a desktop tool, your machine must be within the virtual network. For example, it could be an Azure VM that's connected to one of the subnets, or a machine in an on-premises network that has a [site-to-site VPN](../vpn-gateway/vpn-gateway-about-vpngateways.md) connection with the Azure virtual network.
772773
- You can also [integrate Azure Cloud Shell](../cloud-shell/private-vnet.md) with the virtual network.
773774

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

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -378,7 +378,7 @@ Having issues? Check the [Troubleshooting guide](configure-language-python.md#tr
378378

379379
## 4. Generate database schema
380380

381-
With the PostgreSQL database protected by the virtual network, the easiest way to run [Flask database migrations](https://flask-migrate.readthedocs.io/en/latest/) is in an SSH session with the App Service container.
381+
With the PostgreSQL database protected by the virtual network, the easiest way to run [Flask database migrations](https://flask-migrate.readthedocs.io/en/latest/) is in an SSH session with the Linux container in App Service.
382382

383383
:::row:::
384384
:::column span="2":::
@@ -392,7 +392,7 @@ With the PostgreSQL database protected by the virtual network, the easiest way t
392392
:::row-end:::
393393
:::row:::
394394
:::column span="2":::
395-
**Step 2:** In the SSH terminal, run `flask db upgrade`. If it succeeds, App Service is [connecting successfully to the database](#i-get-an-error-when-running-database-migrations).
395+
**Step 2:** In the SSH session, run `flask db upgrade`. If it succeeds, App Service is [connecting successfully to the database](#i-get-an-error-when-running-database-migrations).
396396
:::column-end:::
397397
:::column:::
398398
:::image type="content" source="./media/tutorial-python-postgresql-app-flask/azure-portal-generate-db-schema-flask-2.png" alt-text="A screenshot showing the commands to run in the SSH shell and their output." lightbox="./media/tutorial-python-postgresql-app-flask/azure-portal-generate-db-schema-flask-2.png":::
@@ -546,17 +546,17 @@ Having issues? Check the [Troubleshooting section](#troubleshooting).
546546
547547
The AZD template you use generated the connectivity variables for you already as [app settings](configure-common.md#configure-app-settings) and outputs the them to the terminal for your convenience. App settings are one way to keep connection secrets out of your code repository.
548548
549-
1. In the AZD output, find the app settings and find the settings `AZURE_POSTGRESQL_USER`, `AZURE_POSTGRESQL_PASSWORD`, `AZURE_POSTGRESQL_HOST`, and `AZURE_POSTGRESQL_NAME`. To keep secrets safe, only the setting names are displayed. They look like this in the azd output:
549+
1. In the AZD output, find the app settings and find the settings `AZURE_POSTGRESQL_USER`, `AZURE_POSTGRESQL_PASSWORD`, `AZURE_POSTGRESQL_HOST`, and `AZURE_POSTGRESQL_NAME`. To keep secrets safe, only the setting names are displayed. They look like this in the AZD output:
550550
551551
<pre>
552-
App Service app has the following connection settings:
553-
- AZURE_POSTGRESQL_NAME
554-
- AZURE_POSTGRESQL_HOST
555-
- AZURE_POSTGRESQL_USER
556-
- AZURE_POSTGRESQL_PASSWORD
557-
- AZURE_REDIS_CONNECTIONSTRING
558-
- AZURE_KEYVAULT_RESOURCEENDPOINT
559-
- AZURE_KEYVAULT_SCOPE
552+
App Service app has the following connection settings:
553+
- AZURE_POSTGRESQL_NAME
554+
- AZURE_POSTGRESQL_HOST
555+
- AZURE_POSTGRESQL_USER
556+
- AZURE_POSTGRESQL_PASSWORD
557+
- AZURE_REDIS_CONNECTIONSTRING
558+
- AZURE_KEYVAULT_RESOURCEENDPOINT
559+
- AZURE_KEYVAULT_SCOPE
560560
</pre>
561561
562562
1. For your convenience, the AZD template shows you the direct link to the app's app settings page. Find the link and open it in a new browser tab.
@@ -613,16 +613,16 @@ Having issues? Check the [Troubleshooting section](#troubleshooting).
613613

614614
## 5. Generate database schema
615615

616-
With the PostgreSQL database protected by the virtual network, the easiest way to run [Flask database migrations](https://flask-migrate.readthedocs.io/en/latest/) is in an SSH session with the App Service container.
616+
With the PostgreSQL database protected by the virtual network, the easiest way to run [Flask database migrations](https://flask-migrate.readthedocs.io/en/latest/) is in an SSH session with the Linux container in App Service.
617617

618618

619-
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:
619+
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:
620620

621621
<pre>
622622
Open SSH session to App Service container at: https://&lt;app-name>.scm.azurewebsites.net/webssh/host
623623
</pre>
624624

625-
1. In the SSH terminal, run `flask db upgrade`. If it succeeds, App Service is [connecting successfully to the database](#i-get-an-error-when-running-database-migrations).
625+
1. In the SSH session, run `flask db upgrade`. If it succeeds, App Service is [connecting successfully to the database](#i-get-an-error-when-running-database-migrations).
626626

627627
:::image type="content" source="./media/tutorial-python-postgresql-app-flask/azure-portal-generate-db-schema-flask-2.png" alt-text="A screenshot showing the commands to run in the SSH shell and their output." lightbox="./media/tutorial-python-postgresql-app-flask/azure-portal-generate-db-schema-flask-2.png":::
628628

@@ -707,7 +707,7 @@ Pricing for the created resources is as follows:
707707
708708
#### How do I connect to the PostgreSQL server that's secured behind the virtual network with other tools?
709709
710-
- For basic access from a command-line tool, you can run `psql` from the app's SSH terminal.
710+
- For basic access from a command-line tool, you can run `psql` from the app's SSH session.
711711
- To connect from a desktop tool, your machine must be within the virtual network. For example, it could be an Azure VM that's connected to one of the subnets, or a machine in an on-premises network that has a [site-to-site VPN](../vpn-gateway/vpn-gateway-about-vpngateways.md) connection with the Azure virtual network.
712712
- You can also [integrate Azure Cloud Shell](../cloud-shell/private-vnet.md) with the virtual network.
713713

0 commit comments

Comments
 (0)