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
+16-6Lines changed: 16 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -109,7 +109,7 @@ Having issues? [Let us know](https://aka.ms/DjangoCLITutorialHelp).
109
109
az group create --name $RESOURCE_GROUP_NAME --location $LOCATION
110
110
```
111
111
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):
113
113
114
114
```azurecli
115
115
az postgres flexible-server create \
@@ -119,7 +119,7 @@ Having issues? [Let us know](https://aka.ms/DjangoCLITutorialHelp).
119
119
--admin-user $ADMIN_USER \
120
120
--admin-password $ADMIN_PW \
121
121
--sku-name Standard_D2ds_v4
122
-
--active-directory-auth Enabled \
122
+
--active-directory-auth Enabled
123
123
```
124
124
125
125
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).
133
133
* Create an administrator account with a username and password specified with the `--admin-user` and `--admin-password` parameters.
134
134
* Create a database which name is specified with the `--database-name` parameter.
135
135
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.)
137
137
138
138
```azurecli
139
139
IP_ADDRESS=<your IP>
@@ -223,10 +223,13 @@ In your Python code, you access these settings as environment variables with sta
223
223
224
224
Having issues? Refer first to the [Troubleshooting guide](../app-service/configure-language-python.md#troubleshooting), otherwise, [let us know](https://aka.ms/DjangoCLITutorialHelp).
225
225
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.
227
232
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.
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
+
```
242
252
243
253
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.
0 commit comments