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/service-connector/tutorial-django-webapp-postgres-cli.md
+19-8Lines changed: 19 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -97,12 +97,13 @@ The following code defines the necessary environment variables for this tutorial
97
97
98
98
## Deploy the app code to App Service
99
99
100
-
Create the app host in App Service and deploy the sample app code to that host. The `az webapp up`command performs the following actions, which might take a few minutes:
100
+
Create the app host in App Service and deploy the sample app code to that host. The `az webapp up`command performs the following actions:
101
101
102
-
* Creates an [App Service plan](../app-service/overview-hosting-plans.md) in the Basic pricing tier (B1).
102
+
* Creates an [App Service plan](/azure/app-service/overview-hosting-plans) in the Basic (B1) pricing tier.
103
103
* Creates the App Service app.
104
104
* Enables default logging for the app.
105
105
* Uploads the repository using ZIP deployment with build automation enabled.
106
+
* Builds the app.
106
107
107
108
In the code, the `sku` defines the CPU, memory, and cost of the App Service plan. The B1 (Basic) service plan incurs a small cost in your Azure subscription. You can omit the `--sku` parameter to use the default SKU, usually P1v3 (Premium v3). For a full list of App Service plans, see [App Service pricing](https://azure.microsoft.com/pricing/details/app-service/linux/).
108
109
@@ -117,7 +118,9 @@ In the code, the `sku` defines the CPU, memory, and cost of the App Service plan
117
118
--sku B1
118
119
```
119
120
120
-
1. After the deployment completes, configure App Service to use the repository *start.sh* file by running the [az webapp config set](/cli/azure/webapp/config#az-webapp-config-set) command.
121
+
The deployment takes a few minutes. Once the app build completes, you can exit out of the command by selecting Ctrl+C.
122
+
123
+
1. Configure the app to use the repository *start.sh* file by running the [az webapp config set](/cli/azure/webapp/config#az-webapp-config-set) command.
121
124
122
125
```azurecli
123
126
az webapp config set \
@@ -143,7 +146,7 @@ Create the Azure Database for PostgreSQL database to store app information. The
143
146
--location $LOCATION \
144
147
--admin-user $ADMIN_USER \
145
148
--admin-password $ADMIN_PW \
146
-
--sku-name Standard_D2ds_v4
149
+
--sku-name Standard_D2ds_v4 \
147
150
--microsoft-entra-auth Enabled
148
151
```
149
152
@@ -239,13 +242,21 @@ Use [az webapp connection create storage-blob](/cli/azure/webapp/connection/crea
239
242
240
243
## Test the Python web app in Azure
241
244
242
-
The app uses the [azure.identity](https://pypi.org/project/azure-identity/) package and its `DefaultAzureCredential` class. When the app is running in Azure, the `DefaultAzureCredential` automatically detects when a managed identity exists for the App Service, and uses it to access the Azure Storage and Azure Database for PostgreSQL resources. You don't need to provide storage keys, certificates, or credentials to App Service to access these resources.
245
+
Open and test the Azure Restaurant Review web app. The app uses the [azure.identity](https://pypi.org/project/azure-identity/) package and its `DefaultAzureCredential` class. When the app is running in Azure, the `DefaultAzureCredential` automatically detects when a managed identity exists for the App Service, and uses it to access the Azure Storage and Azure Database for PostgreSQL resources. The app doesn't need to provide storage keys, certificates, or credentials to access these resources.
246
+
247
+
For a local Azure CLI installation, you can use [`az webapp browse`](/cli/azure/webapp?view=azure-cli-latest#az-webapp-browse) to open the app in your default browser:
248
+
249
+
```azurecli
250
+
az webapp browse --name $APP_SERVICE_NAME.azurewebsites.net --resource-group $RESOURCE_GROUP_NAME
251
+
```
252
+
253
+
Azure Cloud Shell doesn't support the `az webapp browse`command because it can't open a local browser. The easiest way to open the web app is to select the **Default domain** link at upper right on the web app's Azure portal page.
243
254
244
-
1. Browse to the deployed application at the URL `https://$APP_SERVICE_NAME.azurewebsites.net`. It can take a minute or two for the app to start. If you see a default app page that isn't the sample app, wait a minute and refresh the browser.
255
+
It can take a minute or two for the app to start. If you see a default app page that isn't the sample app, wait a minute and refresh the browser.
245
256
246
-
1. Test the functionality of the sample app by adding a restaurant and some reviews with photosfor the restaurant. The app should resemble the following screenshot:
257
+
Test the functionality of the sample app by adding a restaurant and some reviews with photos. The app should resemble the following screenshot:
247
258
248
-
:::image type="content" source="media/tutorial-django-webapp-postgres-cli/example-of-review-sample-app-production-deployed-small.png" lightbox="media/tutorial-django-webapp-postgres-cli/example-of-review-sample-app-production-deployed.png" alt-text="Screenshot of the sample app showing restaurant review functionality using App Service, Azure Database for PostgreSQL, and Azure Storage." :::
259
+
:::image type="content" source="media/tutorial-django-webapp-postgres-cli/example-of-review-sample-app-production-deployed-small.png" lightbox="media/tutorial-django-webapp-postgres-cli/example-of-review-sample-app-production-deployed.png" alt-text="Screenshot of the sample app showing restaurant review functionality using App Service, Azure Database for PostgreSQL, and Azure Storage." :::
0 commit comments