2

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?

Shaun Luttin
  • 133,272
  • 81
  • 405
  • 467
BeniaminoBaggins
  • 11,202
  • 41
  • 152
  • 287

1 Answers1

6

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?

Community
  • 1
  • 1
Shaun Luttin
  • 133,272
  • 81
  • 405
  • 467
  • 1
    Really good detailed answer. AzCopy would be an easy way to do this. I went with the free version of [CloudBerry Explorer for Azure Blob Storage](http://www.cloudberrylab.com/download-thanks.aspx?prod=cbazure) as per the answer in your link at the bottom of your answer (It was the answerers personal favourite). I must say, I used it instantly without needing any tutorial. It has an easy to understand GUI. By the way, I can only view the top 25 images in my container in the Azure portal. Do you know why? Also, is a container for categorising your storage? I have them all in 1 container. – BeniaminoBaggins Sep 06 '15 at 23:37
  • 1
    Yo. It might be that the Azure portal has pagination. Is there a way to click to view the next page. A container could be for categorizing storage. Every blob must be in a container. There is a write up on containers here: https://azure.microsoft.com/en-us/documentation/articles/storage-dotnet-how-to-use-blobs/ – Shaun Luttin Sep 06 '15 at 23:47
  • 1
    Haha yes, the page numbers were covered by an alert to try the new Azure Portal. Thanks! – BeniaminoBaggins Sep 06 '15 at 23:52