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/storage/blobs/storage-upload-process-images.md
+32-43Lines changed: 32 additions & 43 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,11 +1,12 @@
1
1
---
2
2
title: Upload image data in the cloud with Azure Storage | Microsoft Docs
3
3
description: Use Azure Blob storage with a web app to store app data
4
-
author: normesta
4
+
author: mhopkins-msft
5
+
5
6
ms.service: storage
6
7
ms.subservice: blobs
7
8
ms.topic: tutorial
8
-
ms.date: 11/26/2018
9
+
ms.date: 11/16/2019
9
10
ms.author: mhopkins
10
11
ms.reviewer: dineshm
11
12
---
@@ -50,7 +51,8 @@ Create a resource group with the [az group create](/cli/azure/group) command. An
50
51
The following example creates a resource group named `myResourceGroup`.
51
52
52
53
```azurecli-interactive
53
-
az group create --name myResourceGroup --location southeastasia
54
+
az group create --name myResourceGroup --location southeastasia
55
+
54
56
```
55
57
56
58
## Create a storage account
@@ -60,14 +62,13 @@ The sample uploads images to a blob container in an Azure Storage account. A sto
60
62
> [!IMPORTANT]
61
63
> In part 2 of the tutorial, you use Azure Event Grid with Blob storage. Make sure to create your storage account in an Azure region that supports Event Grid. For a list of supported regions, see [Azure products by region](https://azure.microsoft.com/global-infrastructure/services/?products=event-grid®ions=all).
62
64
63
-
In the following command, replace your own globally unique name for the Blob storage account where you see the `<blob_storage_account>` placeholder.
65
+
In the following command, replace your own globally unique name for the Blob storage account where you see the `<blob_storage_account>` placeholder.
64
66
65
67
```azurecli-interactive
66
-
blobStorageAccount=<blob_storage_account>
68
+
$blobStorageAccount="<blob_storage_account>"
69
+
70
+
az storage account create --name $blobStorageAccount --location southeastasia --resource-group myResourceGroup --sku Standard_LRS --kind blobstorage --access-tier hot
67
71
68
-
az storage account create --name $blobStorageAccount \
--sku Standard_LRS --kind blobstorage --access-tier hot
71
72
```
72
73
73
74
## Create Blob storage containers
@@ -79,17 +80,15 @@ Get the storage account key by using the [az storage account keys list](/cli/azu
79
80
The *images* container's public access is set to `off`. The *thumbnails* container's public access is set to `container`. The `container` public access setting permits users who visit the web page to view the thumbnails.
80
81
81
82
```azurecli-interactive
82
-
blobStorageAccountKey=$(az storage account keys list -g myResourceGroup \
echo "Make a note of your Blob storage account key..."
92
90
echo $blobStorageAccountKey
91
+
93
92
```
94
93
95
94
Make a note of your Blob storage account name and key. The sample app uses these settings to connect to the storage account to upload the images.
@@ -104,6 +103,7 @@ The following example creates an App Service plan named `myAppServicePlan` in th
104
103
105
104
```azurecli-interactive
106
105
az appservice plan create --name myAppServicePlan --resource-group myResourceGroup --sku Free
106
+
107
107
```
108
108
109
109
## Create a web app
@@ -113,9 +113,10 @@ The web app provides a hosting space for the sample app code that's deployed fro
113
113
In the following command, replace `<web_app>` with a unique name. Valid characters are `a-z`, `0-9`, and `-`. If `<web_app>` is not unique, you get the error message: _Website with given name `<web_app>` already exists._ The default URL of the web app is `https://<web_app>.azurewebsites.net`.
114
114
115
115
```azurecli-interactive
116
-
webapp=<web_app>
116
+
$webapp="<web_app>"
117
117
118
118
az webapp create --name $webapp --resource-group myResourceGroup --plan myAppServicePlan
119
+
119
120
```
120
121
121
122
## Deploy the sample app from the GitHub repository
@@ -127,27 +128,24 @@ App Service supports several ways to deploy content to a web app. In this tutori
127
128
The sample project contains an [ASP.NET MVC](https://www.asp.net/mvc) app. The app accepts an image, saves it to a storage account, and displays images from a thumbnail container. The web app uses the [Microsoft.Azure.Storage](/dotnet/api/overview/azure/storage), [Microsoft.Azure.Storage.Blob](/dotnet/api/microsoft.azure.storage.blob), and the Microsoft.Azure.Storage.Auth namespaces from the Azure Storage client library to interact with Azure storage.
128
129
129
130
```azurecli-interactive
130
-
az webapp deployment source config --name $webapp \
App Service supports several ways to deploy content to a web app. In this tutorial, you deploy the web app from a [public GitHub sample repository](https://github.com/Azure-Samples/storage-blob-upload-from-webapp-node). Configure GitHub deployment to the web app with the [az webapp deployment source config](/cli/azure/webapp/deployment/source) command.
137
137
138
138
```azurecli-interactive
139
-
az webapp deployment source config --name $webapp \
App Service supports several ways to deploy content to a web app. In this tutorial, you deploy the web app from a [public GitHub sample repository](https://github.com/Azure-Samples/storage-blob-upload-from-webapp-node-v10). Configure GitHub deployment to the web app with the [az webapp deployment source config](/cli/azure/webapp/deployment/source) command.
146
145
147
146
```azurecli-interactive
148
-
az webapp deployment source config --name $webapp \
The sample web app uses the [Azure Storage Client Library](/dotnet/api/overview/azure/storage) to request access tokens, which are used to upload images. The storage account credentials used by the Storage SDK are set in the app settings for the web app. Add app settings to the deployed app with the [az webapp config appsettings set](/cli/azure/webapp/config/appsettings) command.
160
158
161
159
```azurecli-interactive
162
-
az webapp config appsettings set --name $webapp --resource-group myResourceGroup \
az webapp config appsettings set --name $webapp --resource-group myResourceGroup --settings AzureStorageConfig__AccountName=$blobStorageAccount AzureStorageConfig__ImageContainer=images AzureStorageConfig__ThumbnailContainer=thumbnails AzureStorageConfig__AccountKey=$blobStorageAccountKey
161
+
167
162
```
168
163
169
164
# [Node.js V2 SDK](#tab/nodejs)
170
165
171
166
The sample web app uses the [Azure Storage Client Library](https://docs.microsoft.com/javascript/api/azure-storage) to request access tokens, which are used to upload images. The storage account credentials used by the Storage SDK are set in the app settings for the web app. Add app settings to the deployed app with the [az webapp config appsettings set](/cli/azure/webapp/config/appsettings) command.
az webapp config appsettings set --name $webapp --resource-group myResourceGroup --settings AzureStorageConfig__ImageContainer=images AzureStorageConfig__ThumbnailContainer=thumbnails AzureStorageConfig__AccountName=$blobStorageAccount AzureStorageConfig__AccountKey=$blobStorageAccountKey AZURE_STORAGE_CONNECTION_STRING=$storageConnectionString
172
+
183
173
```
184
174
185
175
# [Node.js V10 SDK](#tab/nodejsv10)
186
176
187
177
The sample web app uses the [Azure Storage Client Library](https://github.com/Azure/azure-storage-js) to request access tokens, which are used to upload images. The storage account credentials used by the Storage SDK are set in the app settings for the web app. Add app settings to the deployed app with the [az webapp config appsettings set](/cli/azure/webapp/config/appsettings) command.
188
178
189
179
```azurecli-interactive
190
-
az webapp config appsettings set --name $webapp --resource-group myResourceGroup \
## Verify the image is shown in the storage account
391
380
392
-
Sign in to the [Azure portal](https://portal.azure.com). From the left menu, select **Storage accounts**, then select the name of your storage account. Under**Blob Service**, select **Blobs**, then select the **images** container.
381
+
Sign in to the [Azure portal](https://portal.azure.com). From the left menu, select **Storage accounts**, then select the name of your storage account. Select**Containers**, then select the **images** container.
393
382
394
383
Verify the image is shown in the container.
395
384
@@ -399,7 +388,7 @@ Verify the image is shown in the container.
399
388
400
389
To test thumbnail viewing, you'll upload an image to the **thumbnails** container to check whether the app can read the **thumbnails** container.
401
390
402
-
Sign in to the [Azure portal](https://portal.azure.com). From the left menu, select **Storage accounts**, then select the name of your storage account. Under**Blob Service**, select **Blobs**, then select the **thumbnails** container. Select **Upload** to open the **Upload blob** pane.
391
+
Sign in to the [Azure portal](https://portal.azure.com). From the left menu, select **Storage accounts**, then select the name of your storage account. Select**Containers**, then select the **thumbnails** container. Select **Upload** to open the **Upload blob** pane.
403
392
404
393
Choose a file with the file picker and select **Upload**.
0 commit comments