Azure Blob 400 Bad request on Creation of container

后端 未结 12 2510
夕颜
夕颜 2020-12-15 16:26

I\'m developing an ASP.Net MVC 4 app and I\'m using Azure Blob to store the images that my users are going to upload. I have the following code:

 var storag         


        
12条回答
  •  野趣味
    野趣味 (楼主)
    2020-12-15 16:46

    If you have just updated the WindowsAzure.Storage nuget package and your app started crashing with http error 400 bad request :

    In my case it happened when I updated to 8.2.1 and my local emulator was version 5.1.

    My solution is this :

    1. Go to Microsoft Azure SDK page here.
    2. Search for "Azure Storage Emulator" and download the latest storage emulator. Usually at the middle of the page to the left in "Command-line tools" section
    3. Install the latest emulator
    4. You are good to go.

    When I downloaded Storage Emulator 5.2 and upgraded from 5.1 the errors stopped. Such an error happened several times to me already.

    My humble request if anybody from Microsoft Azure Storage Emulator team reads this - Please add a check for development mode and throw a meaningful exception with the message like - "You have Azure Storage Emulator version X.Y.Z installed. In order to use the current WindowsAzure.Storage library **V.V.V with Azure Emulator you need to install version Z.Z.Z of the emulator from this link".** or whatever you consider useful.

    This kind of problem have wasted several hours of my time and I suppose the same happened to thousands of developers around the world and still this exception sits there - for more than 4 years!

提交回复
热议问题