0
votes

I am trying to access a data storage of the azure stack. The following instructions work:

BlobClient = StorageAccount.CreateCloudBlobClient();
CloudBlobContainer myContainer = BlobClient.GetContainerReference("mycontainer");

But it crashes, when creating the Blob via myContainer.CreateIfNotExists():

...StatusMessage:The value for one of the HTTP headers is not in the correct format.\r\n ErrorCode:\r\nErrorMessage:The value for one of the HTTP headers is not in the correct format.\n RequestId:"hiddenId"...

The behavior is exactly the same for Queues and Tables.

I tried the "Microsoft.WindowsAzure.Storage" library in its older version 7.2.1, version 8.7 and the current version 9.1. (8.7 should be fine regarding this documentation. Another documentation even sais, that every version between 6.2.0 and 8.7.0 should be compatible. 9.1 is not supported for sure.) In the end it is always the above error.

The code runs fine when targeting public Azure storages instead Azure Stack storages.

2
Is your container name “myContainer”? Try changing it to “mycontainer” (all lowercase).Gaurav Mantri
I updated the question: the container names are lowercase and valid. The code works for public cloud storages.BaluJr.
I remember I had a similar issue when trying to copy data into Azure Stack Storage via one of the copy tools. So it might be a real bug in the current API!?BaluJr.
See if you can trace the request/response through Fiddler. You will be able to see more details about the error in response body.Gaurav Mantri
A few things you should check: API requires: Create and write permissions Can you try it with newer versions of WindowsAzure.Storage sdk ? I'm also curious, are you using ApplicationInsights in project?Adam Smith - Microsoft Azure

2 Answers

2
votes

So I finally found out the solution with kind support of Microsoft.

It was indeed a versioning problem, one can find out when understanding this documentation the right way.

I am using Azure Stack version 1.0.180103.2. This is the internal version number an means it has been created on the 3rd of January 2018. This refers to version 1801, in the versioning scheme used within the documentation.

The API version 8.7 is only valid from 1802 on. So I have to look at the bottom of that documentation page under "previous". And there one can see that I have to go back to "Microsoft.WindowsAzure.Storage" library 6.2. Using this library it works.

0
votes

This error could be a result if BlobRequestOptions and OperationContext have not been set, Could you provide values to both then check again? The documentation can be found here: https://docs.microsoft.com/en-us/dotnet/api/microsoft.windowsazure.storage.blob.cloudblobcontainer.createifnotexists?redirectedfrom=MSDN&view=azure-dotnet#overloads