Azure堆栈表存储:HTTP标头的值不是正确的格式

时间:2018-03-22 14:05:51

标签: azure azure-storage azure-stack

我正在尝试访问azure堆栈的数据存储。以下说明有效:

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

但是在通过myContainer.CreateIfNotExists()

创建Blob时崩溃了
  

... StatusMessage:其中一个HTTP标头的值不在   格式正确。\ r \ n ErrorCode:\ r \ n \ nNoMMageage:一个值   HTTP标头的格式不正确。\ n   的requestId:" hiddenId" ...

队列和表的行为完全相同。

我试过" Microsoft.WindowsAzure.Storage"库版本为旧版本7.2.1,版本8.7和当前版本9.1。 (8.7对于this文档应该没问题。Another documentation甚至sais,6.2.0和8.7.0之间的每个版本都应该是兼容的.9.1不支持肯定。)最后它始终是上述错误。

代码公共Azure存储而非Azure Stack存储时,代码运行正常。

2 个答案:

答案 0 :(得分:2)

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.

答案 1 :(得分:0)

如果尚未设置 BlobRequestOptions OperationContext ,可能会导致此错误,您是否可以为两者提供值然后再次检查?可以在此处找到文档:https://docs.microsoft.com/en-us/dotnet/api/microsoft.windowsazure.storage.blob.cloudblobcontainer.createifnotexists?redirectedfrom=MSDN&view=azure-dotnet#overloads