Skip to content

Commit a28e8d9

Browse files
author
Bryce Chen
committed
fix comments
1 parent 472517e commit a28e8d9

File tree

1 file changed

+16
-6
lines changed

1 file changed

+16
-6
lines changed

articles/service-connector/tutorial-django-webapp-postgres-cli.md

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ Having issues? [Let us know](https://aka.ms/DjangoCLITutorialHelp).
109109
az group create --name $RESOURCE_GROUP_NAME --location $LOCATION
110110
```
111111

112-
1. Create the database server (the process takes a few minutes):
112+
1. Create the database server. If prompted to enable access to current client IP address, type `y` for yes. (the process takes a few minutes):
113113

114114
```azurecli
115115
az postgres flexible-server create \
@@ -119,7 +119,7 @@ Having issues? [Let us know](https://aka.ms/DjangoCLITutorialHelp).
119119
--admin-user $ADMIN_USER \
120120
--admin-password $ADMIN_PW \
121121
--sku-name Standard_D2ds_v4
122-
--active-directory-auth Enabled \
122+
--active-directory-auth Enabled
123123
```
124124

125125
If the `az` command isn't recognized, be sure you have the Azure CLI installed as described in [Set up your initial environment](#set-up-your-initial-environment).
@@ -133,7 +133,7 @@ Having issues? [Let us know](https://aka.ms/DjangoCLITutorialHelp).
133133
* Create an administrator account with a username and password specified with the `--admin-user` and `--admin-password` parameters.
134134
* Create a database which name is specified with the `--database-name` parameter.
135135

136-
1. Configure a firewall rule on your server with the [az postgres flexible-server firewall-rule create](/cli/azure/postgres/flexible-server/firewall-rule) command. This rule allows your local environment access to connect to the server. (If you're using the Azure Cloud Shell, you can skip this step.)
136+
1. Configure a firewall rule on your server with the [az postgres flexible-server firewall-rule create](/cli/azure/postgres/flexible-server/firewall-rule) command. This rule allows your local environment access to the server. (If you're prompted to enable access from your client IP address in previous step, you can skip this step.)
137137
138138
```azurecli
139139
IP_ADDRESS=<your IP>
@@ -223,10 +223,13 @@ In your Python code, you access these settings as environment variables with sta
223223

224224
Having issues? Refer first to the [Troubleshooting guide](../app-service/configure-language-python.md#troubleshooting), otherwise, [let us know](https://aka.ms/DjangoCLITutorialHelp).
225225

226-
### Create a connector to Azure Storage account
226+
### Create a storage account and connect to it
227+
228+
1. Use the [az webapp connection create storage-blob](/cli/azure/webapp/connection/create#az-webapp-connection-create-storage-blob) command to create an storage account and creates a service connector that does the following configuraitons:
229+
* Enables system-assigned managed identity on the web app
230+
* Adds the web app with role *Storage Blob Data Contributor* to the newly created storage account.
231+
* Configure the storage account network to accept access from the web app.
227232

228-
1. Add a storage service connector with the [az webapp connection create storage-blob](/cli/azure/webapp/connection/create#az-webapp-connection-create-storage-blob) command.
229-
This command also adds a storage account and adds the web app with role *Storage Blob Data Contributor* to the storage account.
230233
```azurecli
231234
STORAGE_ACCOUNT_URL=$(az webapp connection create storage-blob \
232235
--new true \
@@ -239,6 +242,13 @@ Having issues? Refer first to the [Troubleshooting guide](../app-service/configu
239242
--output tsv)
240243
STORAGE_ACCOUNT_NAME=$(cut -d . -f1 <<< $(cut -d / -f3 <<< $STORAGE_ACCOUNT_URL))
241244
```
245+
1. Update the storage account to allow blob public access for the *restaurant app* users to access images.
246+
247+
```azurecli
248+
az storage account update \
249+
--name $STORAGE_ACCOUNT_NAME \
250+
--allow-blob-public-access
251+
```
242252

243253
1. Create a container called `photos` in the storage account with the [az storage container create](/cli/azure/storage/container#az-storage-container-create) command. Allow anonymous read (public) access to blobs in the newly created container.
244254

0 commit comments

Comments
 (0)