Obtención de una excepción al llamar a CreateIfNotExists (cliente de Azure Blob)
Frecuentes
Visto 3,164 equipos
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.
El servidor remoto devolvió un error: (400) Solicitud incorrecta.
Seguimiento de pila:
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
- Valid name for blob container
- 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.
Actualizar:
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.
2 Respuestas
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 aquí.
Respondido 12 Feb 14, 17:02
0
The valid name for blob container should be in lower case letters
Respondido el 07 de Septiembre de 16 a las 00:09
No es la respuesta que estás buscando? Examinar otras preguntas etiquetadas azure azure-storage azure-blob-storage or haz tu propia pregunta.
Please check the version of storage client library you're using and the SDK version. - Gaurav Mantri
I'd also suggest pointing the same code at a hosted storage account to ensure its not an issue with the local storage emulator. - BrentDaCodeMonkey
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