question

KrushnalPatel-1599 avatar image
0 Votes"
KrushnalPatel-1599 asked SumanthMarigowda-MSFT commented

NodeJS Autorization error even after correct connection string

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-accountsazure-blob-storage
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

deherman-MSFT avatar image
1 Vote"
deherman-MSFT answered

@KrushnalPatel-1599
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.

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.