question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Storage Emulator] Server failed to authenticate the request. Make sure the value of Authorization header is formed correctly including the signature

See original GitHub issue

Hi,

I am getting below error while accessing blob container by using SAS token with storage emulator -

**Server failed to authenticate the request. Make sure the value of Authorization header is formed correctly including the signature

System.AggregateException: One or more errors occurred. (Server failed to authenticate the request. Make sure the value of Authorization header is formed correctly including the signature. RequestId:c3d554bf-ae0c-413d-ba15-ef888f141864 Time:2020-08-19T08:18:01.6796671Z Status: 403 (Server failed to authenticate the request. Make sure the value of Authorization header is formed correctly including the signature.) ErrorCode: AuthenticationFailed

Headers: Server: Microsoft-HTTPAPI/2.0 x-ms-request-id: c3d554bf-ae0c-413d-ba15-ef888f141864 x-ms-error-code: AuthenticationFailed Date: Wed, 19 Aug 2020 08:18:01 GMT Content-Length: 498 Content-Type: application/xml**

Expected behavior What is the expected behavior?

Below are the Exception or Stack Trace details - —> Azure.RequestFailedException: Server failed to authenticate the request. Make sure the value of Authorization header is formed correctly including the signature. RequestId:0b506bfc-ba50-4519-924f-6072c5ba829d Time:2020-08-19T08:47:57.3367759Z Status: 403 (Server failed to authenticate the request. Make sure the value of Authorization header is formed correctly including the signature.) ErrorCode: AuthenticationFailed

Headers: Server: Microsoft-HTTPAPI/2.0 x-ms-request-id: 0b506bfc-ba50-4519-924f-6072c5ba829d x-ms-error-code: AuthenticationFailed Date: Wed, 19 Aug 2020 08:47:57 GMT Content-Length: 498 Content-Type: application/xml

at Azure.Storage.Blobs.BlobRestClient.Service.GetPropertiesAsync_CreateResponse(ClientDiagnostics clientDiagnostics, Response response) at Azure.Storage.Blobs.BlobRestClient.Service.GetPropertiesAsync(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, Uri resourceUri, String version, Nullable`1 timeout, String requestId, Boolean async, String operationName, CancellationToken cancellationToken) at Azure.Storage.Blobs.BlobServiceClient.GetPropertiesInternal(Boolean async, CancellationToken cancellationToken) at Azure.Storage.Blobs.BlobServiceClient.GetPropertiesAsync(CancellationToken cancellationToken)

To Reproduce

  1. I am referring sample example - https://github.com/Azure/azure-sdk-for-net/blob/master/sdk/storage/Azure.Storage.Blobs/samples/Sample02_Auth.cs

  2. Below is the code to reproduce -

` Create a SAS token that’s valid for one hour. BlobSasBuilder sasBuilder = new BlobSasBuilder { BlobContainerName = containerName, Resource = “c”, //StartsOn = DateTimeOffset.UtcNow, //ExpiresOn = DateTimeOffset.UtcNow.AddHours(1) ExpiresOn = DateTimeOffset.MaxValue };

        //Allow read access
        sasBuilder.SetPermissions(BlobContainerSasPermissions.Read);
        
        StorageSharedKeyCredential credential =
            new StorageSharedKeyCredential("Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw==", "devstoreaccount1");

        // Use the key to get the SAS token.
        string sasToken = sasBuilder.ToSasQueryParameters(credential).ToString();

        Console.WriteLine("SAS for blob container is: {0}", sasToken);
        Console.WriteLine();

        // Build a SAS URI
        UriBuilder sasUri = new UriBuilder(containerClient.Uri);
        sasUri.Query = sasToken;

        // Create a client that can authenticate with the SAS URI
        BlobServiceClient service = new BlobServiceClient(sasUri.Uri);
        
         // Make a service request to verify we've successfully authenticated
        await service.GetPropertiesAsync(); //Note - Receiving above error while calling this function
        `

Environment:

  • Azure.Storage.Blobs Version=“12.5.0”
  • NET Core SDKs installed: 2.1.602 [C:\Program Files\dotnet\sdk] 2.1.802 [C:\Program Files\dotnet\sdk] 2.2.202 [C:\Program Files\dotnet\sdk] 2.2.402 [C:\Program Files\dotnet\sdk] 3.1.302 [C:\Program Files\dotnet\sdk]
  • IDE and version : Microsoft Visual Studio Enterprise 2019 Version 16.6.5

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

3reactions
acn-sbuadcommented, Aug 24, 2020

We are experiencing the same error when connecting to blob storage. Started failing when we updated Azure.Storage.Blobs from 12.4.4 to 12.5.1

0reactions
amishra-devcommented, Oct 26, 2021

Hi Folks, Development on the storage emulator has been stopped in favor of Azurite. Could you guys give that a try and let us know if you hit issues?

Read more comments on GitHub >

github_iconTop Results From Across the Web

AzureStorage Blob Server failed to authenticate ...
Server failed to authenticate the request. Make sure the value of Authorization header is formed correctly including the signature. The error ...
Read more >
Azure Blob Storage fails to authenticate: "Make sure the ...
Azure Blob Storage fails to authenticate: "Make sure the value of Authorization header is formed correctly including the signature".
Read more >
Server failed to authenticate the request. · Issue #233
Server failed to authenticate the request. Make sure the value of the Authorization header is formed correctly including the signature.
Read more >
Error Message: “Server failed to authenticate the request. ...
Solution. 1. Navigate to Lasernet Developer > Commands and double-click the Azure storage you are trying to use.
Read more >
Error "Server failed to authenticate the request" while ...
Server failed to authenticate the request. Make sure the value of Authorization header is formed correctly including the signature.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found