Question

I am having problem creating an Azure blob container.

When I call CreateIfNotExists() function I get the following exception :

I have search on internet to see if other folks have the same problem or not. I have found two main reasons for this error.

The remote server returned an error: (400) Bad Request.

Stack Trace :

   at Microsoft.WindowsAzure.Storage.Core.Executor.Executor.ExecuteSync[T](RESTCommand`1 cmd, IRetryPolicy policy, OperationContext operationContext)
   at Microsoft.WindowsAzure.Storage.Blob.CloudBlobContainer.Exists(Boolean primaryOnly, BlobRequestOptions requestOptions, OperationContext operationContext)
   at Microsoft.WindowsAzure.Storage.Blob.CloudBlobContainer.CreateIfNotExists(BlobContainerPublicAccessType accessType, BlobRequestOptions requestOptions, OperationContext operationContext)
   at Microsoft.WindowsAzure.Storage.Blob.CloudBlobContainer.CreateIfNotExists(BlobRequestOptions requestOptions, OperationContext operationContext)
   at Customize.AzureSpecific.ProductPhotoStorageService..ctor() in c:\Users\raha\Desktop\Customize\Customize.AzureSpecific\ProductPhotoStorageService.cs:line 28
   at lambda_method(Closure , IArguments )
   at StructureMap.Construction.BuilderCompiler.FuncCompiler`1.<>c__DisplayClass2.<CreateBuilder>b__0(IArguments args) in c:\BuildAgent\work\767273992e840853\src\StructureMap\Construction\BuilderCompiler.cs:line
  1. Valid name for blob container
  2. The port 1000 is already in use.

None of the above is true, because i tried very simple names and also when I open Storage Emulator I can see that the blob is running on port 1000

Do you guys have any ideas that why this is happening ? any help is appreciated.

Update:

Thank you guys yes you were all correct, the problem was the Storage Emulator version. After installing the preview everything is working as it should.

Was it helpful?

Solution

If you are using Azure Storage Client Library 3.0, please make sure you have the latest preview release of the Azure Storage Emulator, which can be found here.

OTHER TIPS

The valid name for blob container should be in lower case letters

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top