BeniaminoBaggins
BeniaminoBaggins

Reputation: 12433

Upload Images to Azure Storage Using Portal (not programmatically)

I need a SQL Server database that stores images, and their name, category, etc, so the SQL table will have 5 or so columns. I'm using Azure as my SQL Server host. It appears I cannot seem to insert image data into my VARBINARY(MAX) column from SQL Server Management Studio which was my first plan. I cannot do this because I cannot seem to give my user permissions to use BULK LOAD. Azure SQL seems to make this impossible. I think I need to use Azure Storage, and then in the SQL Server database, just store a link to the image.

To be clear, I want the images in the database already, I do not want to add them from within the application I am developing. The application I'm developing will only download the images to the device, not upload them.

So How do I upload the images to Azure Storage using the portal, not using code?

Upvotes: 2

Views: 1113

Answers (1)

Shaun Luttin
Shaun Luttin

Reputation: 141462

So how do I upload the images to Azure Storage using the portal, not using code?

Short Answer

You cannot. The portal does not have a way to upload an image to a storage container from either the old or the new portal.

Alternative

Use the AzCopy Command-Line Utility by Microsoft. It allows you to do what you want with just two command lines. There is terrific tutorial here.

First, download and install the utility. Second, open a command prompt and navigate to the installation AzCopy install directory. Third, upload a file to your storage account. Here are the second and third steps.

> cd C:\Program Files (x86)\Microsoft SDKs\Azure\AzCopy

> AzCopy /Source:folder /Dest:account /DestKey:key /Pattern:file

And here are what the parameters mean.

  • Source The folder on your computer that contains the images to upload.
  • Dest The address of the storage container at which to store the images.
  • DestKey The primary access key for your storage account.
  • Pattern The name of the file to upload (or a pattern).

Example

This uploads an image named my-cat.png from the C:\temp folder on my computer to a storage contained called mvp1. If you wanted to upload all the png images in that folder, you could replace my-cat.png with *.png and it work upload them all.

AzCopy /Source:C:\temp /Dest:https://my.blob.core.windows.net/mvp1 /DestKey:tLlbC59ggDdJ+Dg== /Pattern:my-cat.png

You might also what to take a look at the answers to this question: How do I upload some file into Azure blob storage without writing my own program?

Upvotes: 6

Related Questions