NodeJS Autorization error even after correct connection string

Krushnal Patel 21 Reputation points
2021-05-09T12:24:35.177+00:00

Hi,

I have been trying to use azure for file storage for my app.
For a starting few weeks, it worked perfectly fine but soon I am facing this authorization header error problem which I am unable to diagnose and solve.
I have cross-checked multiple times and am using the correct connection string as AZURE_STORAGE_CONNECTION_STRING environment variable.

This is my error:

StorageError: Server failed to authenticate the request. Make sure the value of Authorization header is formed correctly including the signature.
RequestId:4b2a3ee6-501e-0013-1ecc-443ffb000000
Time:2021-05-09T12:09:01.4678233Z
at Function.StorageServiceClient._normalizeError (/home/krush/github/defianz_site/node_modules/azure-storage/lib/common/services/storageserviceclient.js:1205:23)
at BlobService.StorageServiceClient._processResponse (/home/krush/github/defianz_site/node_modules/azure-storage/lib/common/services/storageserviceclient.js:751:50)
at Request.processResponseCallback [as _callback] (/home/krush/github/defianz_site/node_modules/azure-storage/lib/common/services/storageserviceclient.js:319:37)
at Request.self.callback (/home/krush/github/defianz_site/node_modules/request/request.js:185:22)
at Request.emit (node:events:369:20)
at Request.<anonymous> (/home/krush/github/defianz_site/node_modules/request/request.js:1154:10)
at Request.emit (node:events:369:20)
at IncomingMessage.<anonymous> (/home/krush/github/defianz_site/node_modules/request/request.js:1076:12)
at Object.onceWrapper (node:events:475:28)
at IncomingMessage.emit (node:events:381:22)
at endReadableNT (node:internal/streams/readable:1307:12)
at processTicksAndRejections (node:internal/process/task_queues:81:21) {
code: 'AuthenticationFailed',
authenticationerrordetail: "The MAC signature found in the HTTP request 'upQE51qiAOp0ZtDPhtO/xWAYG6TkdRPzrjyPWMbXPdk=' is not the same as any computed signature. Server used following string to sign: 'PUT\n" +
'\n' +
'\n' +
'258000\n' +
'\n' +
'application/octet-stream\n' +
'\n' +
'\n' +
'\n' +
'\n' +
'\n' +
'\n' +
'x-ms-blob-content-md5:nfJKGlmSd1e5y1OpoUp1iQ==\n' +
'x-ms-blob-content-type:image/jpeg\n' +
'x-ms-blob-type:BlockBlob\n' +
'x-ms-client-request-id:56d19530-b0bf-11eb-9778-b7f42a1d2cca\n' +
'x-ms-date:Sun, 09 May 2021 12:09:00 GMT\n' +
'x-ms-version:2018-03-28\n' +
"/defianzdtusdc/team-members/test-432582.jpg'.",
statusCode: 403,
requestId: '4b2a3ee6-501e-0013-1ecc-443ffb000000'
}

Azure Storage
Azure Storage
Globally unique resources that provide access to data management services and serve as the parent namespace for the services.
3,529 questions
Azure Blob Storage
Azure Blob Storage
An Azure service that stores unstructured data in the cloud as blobs.
3,192 questions
0 comments No comments
{count} votes

Accepted answer
  1. deherman-MSFT 38,021 Reputation points Microsoft Employee Moderator
    2021-05-10T18:33:28.98+00:00

    @Krushnal Patel
    Please check the sample provided here on how to use the connection string with NodeJS. Additional samples can be found on the quickstart page.

    If you are still facing issues please share the code you are working with so we can take a deeper look.

    -------------------------------

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

    1 person found this answer helpful.
    0 comments No comments

0 additional answers

Sort by: Most helpful

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.