How can I successfully send a rest call to listServiceSas to get access to a blob?

Jason Drinen 0 Reputation points
2025-07-28T23:23:05.1933333+00:00

I have tried many variations and continue to get "Signature did not match." when trying to use the resulting link.

Using a post call to listServiceSas?api-version=2023-01-01.

I always get a result, but when using in the full link, always getting this 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. RequestId:128a6ba1-e01e-0045-4c13-00a002000000 Time:2025-07-28T22:58:07.0324265Z</Message>

<AuthenticationErrorDetail>Signature did not match. String to sign used was r 2025-07-28T23:57:25.0000000Z /blob/<storageaccountname>/deploy/3842bd18-caf9-4b84-98cc-a23c00785807 https 2023-08-03 b </AuthenticationErrorDetail>

</Error>

I have tried lots of variations over many hours of the body for this call, including...

{

"canonicalizedResource": "/blob/{StorageAccountName}/{StorageContainerName}/{BlobName}",

"signedResource": "b",

"signedPermission": "r",

"signedProtocol": "https",

"signedExpiry": "{expiry}",

"signedVersion": "2023-08-03"

}

{

"canonicalizedResource": "/blob/{StorageAccountName}/{StorageContainerName}/{BlobName}",

"signedResourceTypes": "o",

"signedResource": "b",

"signedPermission": "r",

"signedProtocol": "https",

"signedExpiry": "{expiry}",

"signedVersion": "2023-08-03"

}

{

"canonicalizedResource": "/blob/{StorageAccountName}/{StorageContainerName}",

"signedResourceTypes": "c",

"signedResource": "c",

"signedPermission": "r",

"signedProtocol": "https",

"signedStart": "{startdatetime}",

"signedExpiry": "{expiry}",

"signedVersion": "2023-08-03"

}

{

"canonicalizedResource": "/blob/{StorageAccountName}/{StorageContainerName}/{BlobName}",

"signedResourceTypes": "o",

"signedResource": "b",

"signedServices": "b",

"signedPermission": "r",

"signedProtocol": "https",

"signedStart": "{startdatetime}",

"signedExpiry": "{expiry}",

"signedVersion": "2023-08-03"

}

Everything matches... no differences in case or anything else that I can see causing this mismatch.

I need to do this as a REST call.. using the access for zipdeploy call downstream.

Azure Storage
Azure Storage
Globally unique resources that provide access to data management services and serve as the parent namespace for the services.
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Nandamuri Pranay Teja 4,445 Reputation points Microsoft External Staff Moderator
    2025-07-29T12:50:10.0966667+00:00

    Hello Jason Drinen

    Looking at your error message, I can see the issue! The problem is in how you're constructing the canonicalizedResource and potentially the datetime formatting.

    To investigate further could you please confirm me the below details.

    • What SDK or tool are you using to generate the SAS token and make the REST call? Have you confirmed that other APIs can work with this SAS token?
    • Can you include the exact request headers and URL you’re using when making the API call?

    However, in the meantime you can try the below steps:

    Based on the error message and your attempts, I can see that the problem is with the canonicalizedResource format and potentially datetime formatting. Looking at your error's AuthenticationErrorDetail: String to sign used was r 2025-07-28T23:57:25.0000000Z /blob/<storageaccountname>/deploy/3842bd18-caf9-4b84-98cc-a23c00785807 https 2023-08-03 b

    For the listServiceSas REST API call, use this exact format:

    {
      "canonicalizedResource": "/blob/{StorageAccountName}/{ContainerName}",
      "signedResource": "c",
      "signedPermission": "r",
      "signedProtocol": "https",
      "signedExpiry": "2025-07-28T23:57:25Z",
      "signedVersion": "2023-08-03"
    }
    

    Corrections Needed on the above error:

    • Correct: "/blob/{StorageAccountName}/{ContainerName}"
    • Wrong: "/blob/{StorageAccountName}/{ContainerName}/{BlobName}"
    • For blob-level access, use signedResource: "c" (container) not "b" (blob)

    Remove signedResourceTypes, signedServices, signedStart unless specifically needed.

    {
      "canonicalizedResource": "/blob/mystorageaccount/deploy",
      "signedResource": "c",
      "signedPermission": "r",
      "signedProtocol": "https", 
      "signedExpiry": "2025-07-29T00:00:00Z",
      "signedVersion": "2023-08-03"
    }
    

    Let me know if you have any question or concerns.


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.