Skip to content

Commit ec1fec9

Browse files
Merge pull request #274959 from gbowerman/patch-3
Update tutorial-webapp-server-vnet.md - replace deprecated content
2 parents 10b594a + 9cc6a11 commit ec1fec9

File tree

1 file changed

+22
-22
lines changed

1 file changed

+22
-22
lines changed

articles/postgresql/flexible-server/tutorial-webapp-server-vnet.md

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ description: Quickstart guide to create an Azure Database for PostgreSQL - Flexi
44
author: gbowerman
55
ms.author: guybo
66
ms.reviewer: maghan
7-
ms.date: 04/27/2024
7+
ms.date: 05/09/2024
88
ms.service: postgresql
99
ms.subservice: flexible-server
1010
ms.topic: tutorial
@@ -18,9 +18,9 @@ ms.devlang: azurecli
1818

1919
[!INCLUDE [applies-to-postgresql-flexible-server](../includes/applies-to-postgresql-flexible-server.md)]
2020

21-
This tutorial shows you how create a Azure App Service Web app with Azure Database for PostgreSQL flexible server inside a [Virtual network](../../virtual-network/virtual-networks-overview.md).
21+
This tutorial shows you how to create a Azure App Service Web app with Azure Database for PostgreSQL flexible server inside a [Virtual network](../../virtual-network/virtual-networks-overview.md).
2222

23-
In this tutorial you will learn how to:
23+
In this tutorial you'll learn how to:
2424
>[!div class="checklist"]
2525
> * Create an Azure Database for PostgreSQL flexible server instance in a virtual network
2626
> * Create a web app
@@ -30,8 +30,8 @@ In this tutorial you will learn how to:
3030
## Prerequisites
3131

3232
- If you don't have an Azure subscription, create a [free](https://azure.microsoft.com/free/) account before you begin.
33-
- [Install Azure CLI](/cli/azure/install-azure-cli).version 2.0 or later locally. To see the version installed, run the `az --version` command.
34-
- Login to your account using the [az login](/cli/azure/authenticate-azure-cli) command. Note the **id** property from the command output for the corresponding subscription name.
33+
- [Install Azure CLI](/cli/azure/install-azure-cli) version 2.0 or later locally (or use [Azure Cloud Shell](https://azure.microsoft.com/get-started/azure-portal/cloud-shell/) which has CLI preinstalled). To see the version installed, run the `az --version` command.
34+
- Log in to your account using the [az login](/cli/azure/authenticate-azure-cli) command. Note the **id** property from the command output for the corresponding subscription name.
3535

3636
```azurecli
3737
az login
@@ -53,22 +53,22 @@ This command performs the following actions, which may take a few minutes:
5353

5454
- Create the resource group if it doesn't already exist.
5555
- Generates a server name if it's not provided.
56-
- Create a new virtual network for your new Azure Database for PostgreSQL flexible server instance and subnet within this virtual network for the Azure Database for PostgreSQL flexible server instance.
57-
- Creates admin username , password for your server if not provided.
58-
- Creates an empty database called **postgres**
56+
- Creates a virtual network and subnet for the Azure Database for PostgreSQL flexible server instance.
57+
- Creates admin username and password for your server if not provided.
58+
- Creates an empty database called **postgres**.
5959

60-
Here is the sample output.
60+
Here's the sample output.
6161

6262
```json
63-
Local context is turned on. Its information is saved in working directory /home/jane. You can run `az local-context off` to turn it off.
64-
Command argument values from local context: --resource-group demoresourcegroup, --location: eastus
65-
Checking the existence of the resource group ''...
66-
Creating Resource group 'demoresourcegroup ' ...
67-
Creating new vnet "demoappvnet" in resource group "demoresourcegroup" ...
68-
Creating new subnet "Subnet095447391" in resource group "demoresourcegroup " and delegating it to "Microsoft.DBforPostgreSQL/flexibleServers"...
69-
Creating Azure Database for PostgreSQL flexible server instance 'demoserverpostgres' in group 'demoresourcegroup'...
63+
Creating Resource Group 'demoresourcegroup'...
64+
Creating new Vnet "demoappvnet" in resource group "demoresourcegroup"
65+
Creating new Subnet "Subnetdemoserverpostgres" in resource group "demoresourcegroup"
66+
Creating a private dns zone demoserverpostgres.private.postgres.database.azure.com in resource group "demoresourcegroup"
67+
Creating PostgreSQL Server 'demoserverpostgres' in group 'demoresourcegroup'...
7068
Your server 'demoserverpostgres' is using sku 'Standard_D2s_v3' (Paid Tier). Please refer to https://aka.ms/postgres-pricing for pricing details
71-
Make a note of your password. If you forget, you have to reset your password with 'az postgres flexible-server update -n demoserverpostgres --resource-group demoresourcegroup -p <new-password>'.
69+
Creating PostgreSQL database 'flexibleserverdb'...
70+
Make a note of your password. If you forget, you would have to reset your password with "az postgres flexible-server update -n demoserverpostgres -g demoresourcegroup -p <new-password>".
71+
Try using 'az postgres flexible-server connect' command to test out connection.
7272
{
7373
"connectionString": "postgresql://generated-username:generated-password@demoserverpostgres.postgres.database.azure.com/postgres?sslmode=require",
7474
"host": "demoserverpostgres.postgres.database.azure.com",
@@ -77,16 +77,16 @@ Make a note of your password. If you forget, you have to reset your password wit
7777
"password": "generated-password",
7878
"resourceGroup": "demoresourcegroup",
7979
"skuname": "Standard_D2s_v3",
80-
"subnetId": "/subscriptions/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx/resourceGroups/demoresourcegroup/providers/Microsoft.Network/virtualNetworks/VNET095447391/subnets/Subnet095447391",
80+
"subnetId": "/subscriptions/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx/resourceGroups/demoresourcegroup/providers/Microsoft.Network/virtualNetworks/demoappvnet/subnets/Subnetdemoserverpostgres",
8181
"username": "generated-username",
8282
"version": "12"
8383
}
8484
```
8585

8686
## Create a Web App
87-
In this section, you create app host in App Service app, connect this app to the Azure Database for PostgreSQL flexible server database, then deploy your code to that host. Make sure you're in the repository root of your application code in the terminal. Note Basic Plan does not support VNET integration. Please use Standard or Premium.
87+
In this section, you create app host in App Service app, connect this app to the Azure Database for PostgreSQL flexible server database, then deploy your code to that host. Make sure you're in the repository root of your application code in the terminal. Note Basic Plan doesn't support VNET integration. Use Standard or Premium.
8888

89-
Create an App Service app (the host process) with the az webapp up command
89+
Create an App Service app (the host process) with the az webapp up command.
9090

9191
```azurecli
9292
az webapp up --resource-group demoresourcegroup --location westus2 --plan testappserviceplan --sku P2V2 --name mywebapp
@@ -124,7 +124,7 @@ az webapp vnet-integration add --resource-group demoresourcegroup -n mywebapp -
124124
```
125125

126126
## Configure environment variables to connect the database
127-
With the code now deployed to App Service, the next step is to connect the app to the Azure Database for PostgreSQL flexible server instance in Azure. The app code expects to find database information in a number of environment variables. To set environment variables in App Service, use [az webapp config appsettings set](/cli/azure/webapp/config/appsettings#az-webapp-config-appsettings-set) command.
127+
With the code now deployed to App Service, the next step is to connect the app to the Azure Database for PostgreSQL flexible server instance in Azure. The app code expects to find database information in many environment variables. To set environment variables in App Service, use [az webapp config appsettings set](/cli/azure/webapp/config/appsettings#az-webapp-config-appsettings-set) command.
128128

129129

130130
```azurecli
@@ -134,7 +134,7 @@ az webapp config appsettings set --name mywebapp --settings DBHOST="<postgres-s
134134
- Replace **postgres-server-name**,**username**,**password** for the newly created Azure Database for PostgreSQL flexible server instance command.
135135
- Replace **\<username\>** and **\<password\>** with the credentials that the command also generated for you.
136136
- The resource group and app name are drawn from the cached values in the .azure/config file.
137-
- The command creates settings named **DBHOST**, **DBNAME**, **DBUSER***, and **DBPASS**. If your application code is using different name for the database information then use those names for the app settings as mentioned in the code.
137+
- The command creates settings named **DBHOST**, **DBNAME**, **DBUSER***, and **DBPASS**. If your application code is using a different name for the database information, then use those names for the app settings as mentioned in the code.
138138

139139
Configure the web app to allow all outbound connections from within the virtual network.
140140
```azurecli

0 commit comments

Comments
 (0)