0

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.

BaluJr.
  • 1,010
  • 2
  • 11
  • 25
  • Is your container name “myContainer”? Try changing it to “mycontainer” (all lowercase). – Gaurav Mantri Mar 22 '18 at 14:13
  • I updated the question: the container names are lowercase and valid. The code works for public cloud storages. – BaluJr. Mar 22 '18 at 14:26
  • I remember I had a similar issue when trying to copy data into Azure Stack Storage via one of the [copy tools](https://learn.microsoft.com/en-us/azure/azure-stack/user/azure-stack-storage-transfer). So it might be a real bug in the current API!? – BaluJr. Mar 22 '18 at 14:39
  • 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 Mar 22 '18 at 14:54
  • 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 Mar 22 '18 at 16:07
  • Hi Adam. No Application Insights in the project. WindowsAzure.Storage version 9.1 should be the up-to-date version. Regarding "Create and write permissions", I don't change anything between local ServiceFabric Execution and Execution on Azure Stack besides the ConnectionString (For Azure Stack ...;EndpointSuffix=local.azurestack.external") – BaluJr. Mar 22 '18 at 17:00
  • you should install Fiddler and look at the request in raw format and paste it in the question. – Saher Ahwal Mar 22 '18 at 17:59
  • Any idea what the connection string will look like when using the Fiddler Proxy for an Azure Stack Store as a target. Only find [this](https://blog.maartenballiauw.be/post/2014/05/21/optimizing-calls-to-azure-storage-using-fiddler.html) documentation for using Fiddler together with development storage. But it somehow throws an error "The remote name 'ipv4.fiddler' could not be resolved'. Is this approach from 2014 too old? – BaluJr. Mar 23 '18 at 01:54

2 Answers2

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.

BaluJr.
  • 1,010
  • 2
  • 11
  • 25
0

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://learn.microsoft.com/en-us/dotnet/api/microsoft.windowsazure.storage.blob.cloudblobcontainer.createifnotexists?redirectedfrom=MSDN&view=azure-dotnet#overloads

  • Is there a different behavior between Azure Stack Storage and Public Storage? Because I did not change anything. The behavior is the same for Queues and Tables. So no Blob related issue. – BaluJr. Mar 22 '18 at 17:12
  • I'd recommend checking this link: https://learn.microsoft.com/en-us/azure/azure-stack/user/azure-stack-acs-differences Let me know if you've tried the two parameters to see if it fixes the issue. I'm not aware of any recent changes, since i've only found one thread. – Adam Smith - Microsoft Azure Mar 22 '18 at 17:16
  • The should behave in consistent way @BaluJr. however you might be using a newer version that Azure Stack doesn't allow possibly or the newer version changed format of some headers... Ensure you are running the SDK that Azure Stack supports, nothing later. – Saher Ahwal Mar 22 '18 at 18:01
  • I downgraded back to version 8.7 for all projects. The compatibility of this version number has been confirmed (here)[https://learn.microsoft.com/en-us/azure/azure-stack/user/azure-stack-storage-dev]. Unfortunately, it still does not work out when calling CreateIfNotExist. – BaluJr. Mar 23 '18 at 00:44