azurepostmanazure-storageazure-queuesazure-rest-api

Server failed to authenticate the request - Azure Queue Storage REST API (PUT Method)


Following this TechCommunity MS Article for Storage Queue Data Migration:

From that article, 1st REST API of Listing Queues on Source Storage account is working perfectly.

Now, working on the 2nd REST API marked with the statement:

Create queues with the same names in the Target storage account.

Context: This REST API puts the source storage queues to the destination storage account.

I do not know where to get the values for these headers: x-ms-request-id, x-ms-version and Date to pass in the Post Method REST API.

I only know the value of below headers:

Server: Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0

enter image description here

My Rest API: https://deststore121.queue.core.windows.net/azure-webjobs-blobtrigger-csstechwebapp?<SOURCE_STORAGE_SAS_TOKEN>

Error:

<Error>
    <Code>AuthenticationFailed</Code>
    <Message>Server failed to authenticate the request. Make sure the value of Authorization header is formed correctly including the signature.
Time:2024-03-06T06:11:20.2934664Z</Message>

Solution

  • Create queues with the same names in the Target storage account.

    I followed the same document you shared in my environment.

    First step:

    To list the queues, use the source storage account URL with the source SAS token.

    Postman:

    enter image description here

    Now, to create the same queue in a different storage or destination storage account, you need to create a SAS token in the destination storage account.

    In my environment, I created a SAS token from the destination storage account through the portal.

    Second step:

    To create a new queue in the destination storage account follow below request.

    Postman:

    enter image description here

    Portal: enter image description here

    Reference:

    Create Queue (REST API) - Azure Storage | Microsoft Learn