1

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.

3
  • 1
    Please check the version of storage client library you're using and the SDK version. Feb 12, 2014 at 7:48
  • I'd also suggest pointing the same code at a hosted storage account to ensure its not an issue with the local storage emulator. Feb 12, 2014 at 13:53
  • I am using the latest version of Storage Client Library, I try to update it every time a new version is available on Nuget so that is probably my problem. As Serdar Ozler mentioned I will probably have to get the Azure Storage Emulator preview release. Once I get home I will try that and keep you posted.
    – Raha
    Feb 12, 2014 at 21:59

2 Answers 2

3

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.

0

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.