0
votes

I have the sas token with write permission but when I am trying to write the blob getting the below error.

Server failed to authenticate the request. Make sure the value of Authorization header is formed correctly including the signature. RequestId:6c52482f-c01e-001c-5891-b2f06f000000 Time:2020-11-04T10:03:01.6761446Z Status: 403 (Server failed to authenticate the request. Make sure the value of Authorization header is formed correctly including the signature.) ErrorCode: AuthenticationFailed

Headers: x-ms-request-id: 6c52482f-c01e-001c-5891-b2f06f000000 x-ms-error-code: AuthenticationFailed Date: Wed, 04 Nov 2020 10:03:00 GMT Server: Microsoft-HTTPAPI/2.0 Content-Length: 529 Content-Type: application/xml

Code:

var blobClient = new BlobClient(new Uri(command.AzureBlobContainerTargetUri.AbsoluteUri));
using (var ms = new MemoryStream())
{
    LoadStreamWithJson(ms, JsonConvert.SerializeObject(userData));
    await blobClient.UploadAsync(ms);
}

command.AzureBlobContainerTargetUri.AbsoluteUri --> sas token uri userData- some object

1
Can you refresh the key in the portal and try again.SumanthMarigowda-MSFT

1 Answers

0
votes

The error is always related to your access key as SumanthMarigowda said in the comment. Please regenerate the key in the portal and try with the new one. And check your PC's time, in addition to time check your VPN as well.

I also faced the error when using DefaultAzureCredential(). This is the issue(see the UPDATE) with Python.