Storage Gen2 API in Postman

Shiv Khullar 1 Reputation point
2020-12-23T23:58:09.51+00:00

Hi ,

I am new to Azure Portal and would like to use the Azure Gen2 API to create the files on storage.

I have been able to generate the access token in Postman -

https://login.microsoftonline.com/\<tenant id>/oauth2/v2.0/token

I now have access token to be used.

Now I call -

https://storageaccountshiv.dfs.core.windows.net/blue?resource=filesystem

Headers passed are -

Authorization : Bearer {access token}
x-ms-version : 2020-12-23
Content-Length : 0

But complains
{
"error": {
"code": "InvalidHeaderValue",
"message": "The value for one of the HTTP headers is not in the correct format.\nRequestId:34111c9a-d01f-0004-1787-d9cf50000000\nTime:2020-12-23T23:55:50.5175280Z"
}
}

I went through some posts and it says this is what we need to pass. Any idea what could be missing here.

This should create a folder under "Blob Containers".. Correct?

Thanks in advance.

Thanks,
Shiv

Azure Storage Explorer
Azure Storage Explorer
An Azure tool that is used to manage cloud storage resources on Windows, macOS, and Linux.
266 questions
Azure Storage Accounts
Azure Storage Accounts
Globally unique resources that provide access to data management services and serve as the parent namespace for the services.
3,225 questions
Azure Role-based access control
Azure Role-based access control
An Azure service that provides fine-grained access management for Azure resources, enabling you to grant users only the rights they need to perform their jobs.
830 questions
0 comments No comments
{count} votes

10 answers

Sort by: Most helpful
  1. Sumarigo-MSFT 47,021 Reputation points Microsoft Employee
    2020-12-25T16:20:27.133+00:00

    @Shiv Khullar Firstly, apologies for the delay in responding here and any inconvenience this issue may have caused. Based on the error message, please refer to the suggestion mentioned in this SO thread and let me know the status of the issue.

    The documentation article Versioning for the Azure Storage services also suggests the latest API version at the top.

    Create a container

    If the above-mentioned suggestions don't help you or fix your issue, Please let me know I would like to work closer on this issue,

    Hope this helps!

    Kindly let us know if the above helps or you need further assistance on this issue.

    ---------------------------------------------------------------------------------------------------------------

    Please don’t forget to "Accept the answer” and “up-vote” wherever the information provided helps you, this can be beneficial to other community members.

    0 comments No comments

  2. Shiv Khullar 1 Reputation point
    2020-12-25T18:20:43.67+00:00

    Hi Sumarigo,

    Thanks for getting back to me. Much appreciated.

    So, I followed the links you shared and generated the SAS (Shared access signature) token.

    I used connection string URL from there and appended to my URL in Postman like -

    https://storageaccountshiv.dfs.core.windows.net/shiv?resource=filesystem&BlobEndpoint=https://storageaccountshiv.blob.core.windows.net/;QueueEndpoint=https://storageaccountshiv.queue.core.windows.net/;FileEndpoint=https://storageaccountshiv.file.core.windows.net/;TableEndpoint=https://storageaccountshiv.table.core.windows.net/;SharedAccessSignature=sv=2019-12-12&ss=bfqt&srt=sco&sp=rwdlacupx&se=2020-12-26T01:52:21Z&st=2020-12-25T17:52:21Z&spr=https,http&sig=hNmiAsVfOKl5WUbgZCX00hFGCLtEOuafjuO2DDHsud%2Fg%3D

    Also changed x-ms-version to 2020-04-08

    I still get the error as -

    {
    "error": {
    "code": "InvalidAuthenticationInfo",
    "message": "Authentication information is not given in the correct format. Check the value of Authorization header.\nRequestId:5f03dfc0-001f-012b-54e8-da083f000000\nTime:2020-12-25T18:06:02.8681067Z"
    }
    }

    51213-capture.png

    0 comments No comments

  3. Shiv Khullar 1 Reputation point
    2020-12-25T18:33:25.493+00:00

    Tried SAS token as well but still doesnt work -

    https://storageaccountshiv.dfs.core.windows.net/shiv?resource=filesystem&?sv=2019-12-12&ss=bfqt&srt=sc&sp=rwdlacupx&se=2020-12-26T02:30:02Z&st=2020-12-25T18:30:02Z&spr=https,http&sig=uWCZjHJ7lVUeKByugrrEq6OCdV6QDguR9qOO%2FtlOg0w%3D

    {
    "error": {
    "code": "InvalidAuthenticationInfo",
    "message": "Authentication information is not given in the correct format. Check the value of Authorization header.\nRequestId:732c3822-201f-00dd-3eec-da697c000000\nTime:2020-12-25T18:31:52.6398753Z"
    }
    }

    0 comments No comments

  4. Shiv Khullar 1 Reputation point
    2020-12-28T15:08:41.267+00:00

    Hi Sumarigo,

    Can we have a call for you to show me how this works.. This is little critical for us to get this going.

    Thanks,
    Shiv


  5. 2020-12-29T00:18:45.573+00:00

    Hello, regarding the InvalidAuthenticationInfo error, please inspect the HTTP response www-authenticate header for more information about the error.

    Please let me know if you need more help. If the answer was helpful to you, please accept it and, optionally, provide feedback so that other members in the community can benefit from it.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.