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.
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.