Home > Mobile >  Visual studio 2022 with azurite integrated (v3.14.1) In creation of local blob container gives error
Visual studio 2022 with azurite integrated (v3.14.1) In creation of local blob container gives error

Time:03-22

This is the error that is thrown:

Headers: Server: Azurite-Blob/3.14.1 x-ms-error-code: InvalidHeaderValue x-ms-request-id: a3aca2f1-c0af-4af5-a54c-d7e24c188ba0 Date: Mon, 21 Mar 2022 13:22:04 GMT Connection: keep-alive Keep-Alive: REDACTED Transfer-Encoding: chunked Content-Type: application/xml

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<Error>
<Code>InvalidHeaderValue</Code>
 <Message>The value for one of the HTTP headers is not in the correct format.
RequestId:a3aca2f1-c0af-4af5-a54c-d7e24c188ba0
Time:2022-03-21T13:22:04.189Z</Message>
<HeaderName>x-ms-version</HeaderName>
<HeaderValue>2021-04-10</HeaderValue>
</Error>

If I look on Github : https://github.com/Azure/Azurite .And read the description from : API Version Compatible Strategy

If an incoming request has a higher API version than Azurite, Azurite will return a InvalidHeaderValue error for x-ms-version (HTTP status code 400 - Bad Request).

What can be correct because in the api errormessage it claims that there is a headervalue : HeaderValue: 2021-04-10 (what is the newest api version 3.16.0 of Azurite see github). And if you look to the error again in the Headers is the azurite(server) AZurite-blob/3.14.1 . The version that is delivered with VS2022. So, this means that the headervalue is from the latest azurite version, but the azurite server that is used is version 3.14.1

My question is how can I upgrade my local azurite version to 3.16.0 or downgrade some process that uses v3.16.0 to 3.14.1

I hope somebody can help me out here. Thanks in advance. Regards, Marc

CodePudding user response:

Each version of the SDK as well as Azurite targets a specific REST API version. The reason you are getting this error is because installed version of Azurite targets an older REST API version than the SDK you are using.

Two possible solutions:

  1. Upgrade the Azurite version: If you have installed Azurite through npm, simply execute the following command to upgrade to the latest version of Azurite.
npm update -g azurite
  1. Downgrade the SDK version: You can downgrade the SDK version from 12.11.0 to 12.10.0. Please check the changelog before downgrading to ensure that your code is not using anything specific to the latest version. You will need to uninstall version 12.11.0 and then install 12.10.0.
  • Related