Are probably the worst. I was getting the following error message when trying to upload to Azure Blob Storage but only for some of the documents we were syncing.

ExceptionType: Azure.RequestFailedException
Exception: Server failed to authenticate the request. Make sure the value of Authorization header is formed correctly including the signature.
RequestId:bd3ea564-c01e-006e-5101-bb0104000000
Time:2025-05-02T01:26:31.8311894Z
Status: 403 (Server failed to authenticate the request. Make sure the value of Authorization header is formed correctly including the signature.)
ErrorCode: AuthenticationFailed
Additional Information:
AuthenticationErrorDetail: The MAC signature found in the HTTP request '+sggcdqdlxWNBFWfXIV1BCN9aXGMtFe8kyL4YvOLrn0=' is not the same as any computed signature. Server used following string to sign: 'PUT
1048193
application/octet-stream
x-ms-access-tier:Cool
x-ms-blob-content-type:application/pdf
x-ms-blob-type:BlockBlob
x-ms-client-request-id:3d2d12fc-236f-4336-aa4a-9d82577e25a6
x-ms-date:Fri, 02 May 2025 01:26:31 GMT
x-ms-meta-customerid:569006
x-ms-return-client-request-id:true
x-ms-version:2021-08-06
...'.
Content:
<?xml version="1.0" encoding="utf-8"?><Error><Code>AuthenticationFailed</Code><Message>Server failed to authenticate the request. Make sure the value of Authorization header is formed correctly including the signature.
RequestId:bd3ea564-c01e-006e-5101-bb0104000000
Time:2025-05-02T01:26:31.8311894Z</Message><AuthenticationErrorDetail>The MAC signature found in the HTTP request '+sggcdqdlxWNBFWfXIV1BCN9aXGMtFe8kyL4YvOLrn0=' is not the same as any computed signature. Server used following string to sign: 'PUT
1048193
application/octet-stream
x-ms-access-tier:Cool
x-ms-blob-content-type:application/pdf
x-ms-blob-type:BlockBlob
x-ms-client-request-id:3d2d12fc-236f-4336-aa4a-9d82577e25a6
x-ms-date:Fri, 02 May 2025 01:26:31 GMT
x-ms-meta-customerid:569006
x-ms-return-client-request-id:true
x-ms-version:2021-08-06
...</AuthenticationErrorDetail></Error>
Headers:
Server: Microsoft-HTTPAPI/2.0
x-ms-request-id: bd3ea564-c01e-006e-5101-bb0104000000
x-ms-error-code: AuthenticationFailed
Date: Fri, 02 May 2025 01:26:31 GMT
Content-Length: 950
Content-Type: application/xml

Turns out, blob meta data have a few requirements:

• Metadata keys must be alphanumeric and can include dashes (-) and underscores (_).
• Keys cannot contain spaces or special characters.
• Values must be strings and cannot contain invalid characters.

We were reading this from another system and it just so happens that some of their ids came back with a leading space. That caused the upload to crash. It took a while to figure out what the problem was though. Meta data values can have spaces as long as they’re not in the beginning of the value

Leave a comment