Azure Blob Storage not being able to Authenticate "Server failed to authenticate the request. Make sure the value of Authorization header is formed correctly including the signature."

Fahima Chowdhury 0 Reputation points Microsoft Employee
2024-07-16T22:56:52.67+00:00

Hello,
I m trying to do a GetFile operation, and my SAS token is failing to authenticate with this error. ('Server failed to authenticate the request. Make sure the value of Authorization header is formed correctly including the signature.\nRequestId:1b5ebed2-b01e-0005-37c3-d758f5000000\nTime:2024-07-16T21:02:10.9452279Z\nErrorCode:AuthenticationFailed\nauthenticationerrordetail:Signature did not match. String to sign used was racwdl\n2024-07-15T20:50:33Z\n2024-07-18T04:50:33Z\n/blob/probationblobstorage2024/209430947\ndb5a8c19-7e27-4a4f-992b-5dc93849f181\n33e01921-4d64-4f8c-a055-5bdaffd5e33d\n2024-07-15T20:50:33Z\n2024-07-18T04:50:33Z\nb\n2022-11-02\n\n\n\n\n\n2022-11-02\nc\n\n\n\n\n\n\n',).

I am using User delegation to create the SAS token. Please help me understand what is wrong in here. It's been a long journey and it's been very frustrating.

Azure Blob Storage
Azure Blob Storage
An Azure service that stores unstructured data in the cloud as blobs.
2,920 questions
{count} votes

3 answers

Sort by: Most helpful
  1. Deleted

    This answer has been deleted due to a violation of our Code of Conduct. The answer was manually reported or identified through automated detection before action was taken. Please refer to our Code of Conduct for more information.


    Comments have been turned off. Learn more

  2. Nehruji R 8,146 Reputation points Microsoft Vendor
    2024-07-17T13:22:32.2+00:00

    Hello Fahima Chowdhury,

    Greetings! Welcome to Microsoft Q&A Platform.

    I understand that you are trying to perform get file operation and getting error with SAS token which is failing to authenticate ('Server failed to authenticate the request. Make sure the value of Authorization header is formed correctly including the signature) as the error is related to authentication. The error message suggests that the request is not authenticated.

    Please consider checking the following factors to resolve the issue,

    1. Check if the SAS token has expired. Even though the SAS token has valid dates, it is possible that it has expired. Make sure that the SAS token is still valid and has not expired.
    2. Check if the SAS token has the correct permissions. Make sure that the SAS token has the correct permissions to upload files to the Azure storage account.
    3. Check if the SAS token has the correct format. Make sure that the SAS token has the correct format and that it includes all the required parameters.
    4. Check if there are any network connectivity issues. Make sure that there are no network connectivity issues that may be preventing the request from being authenticated.
    5. Verify System Time (Make sure that the system time on the machine generating the SAS token is accurate. A significant time discrepancy could lead to authentication failures)
    6. Try to regenerate New SAS token and upload
    7. For testing purpose can you upload using Storage account key and Storage explorer or azcopy tool?

    Try to create a SAS URI at the storage account level instead of container level to fix the authentication issue. More examples are available in the CLI documentation. Make sure you include all the necessary permissions for the SAS token, a list can be found here.

    refer - https://learn.microsoft.com/en-us/rest/api/storageservices/create-user-delegation-sas

    Few more workaround options are discussed at this link: azurestorage-blob-server-failed-to-authenticate-the-request-make-sure-the-value

    Similar SO thread for reference - https://stackoverflow.com/questions/58565283/azure-blob-storage-sas-error-authenticationfailed, https://stackoverflow.com/questions/25038429/azure-shared-access-signature-signature-did-not-match, https://github.com/Azure/azure-sdk-for-java/issues/38467.

    Please let us know if this solves the issue and do let us know if you have any further queries.


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


  3. KarthikShanth 26 Reputation points
    2024-10-11T14:54:54.8733333+00:00

    I have the exact same problem. I can use the same SAS token to connect to my Blob storage account, list and download the blob.

    But the problem occurs when I try to do upload blob operation. I also set the connection timeout to 600. I am using Python azure blob sdk api to do the file ops.

    Can you help?


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.