Invalid signature in Authorization header in using Azure Monitor data collector API

Daniel Donohue 0 Reputation points

I have translated the Python example in the documentation of how to construct the signature required in the Authorization header for requests made to the data collector API, into Rust. My Rust program produces a SharedKey <workspace_id>:<signature> that is rejected by the server with the body of the response simply saying

{\\\"Error\\\":\\\"InvalidAuthorization\\\",\\\"Message\\\":\\\"An invalid signature was specified in the Authorization header\\\"}

On the other hand, I've taken the same date in RFC1123 format from the Rust program execution and hardcoded it in the Python example script. It produces the exact same SharedKey <workspace_id>:<signature> value for the authorization header and is successful in using the API to send logs.

There is no other information about the nature of the problem with the signature from the Rust program in the response. As far as I can tell, the error is perhaps reporting the wrong problem, since they are exactly the same signature and one works while the other doesn't.

What other reasons could this error type be returned from this API?

Azure Monitor
Azure Monitor
An Azure service that is used to collect, analyze, and act on telemetry data from Azure and on-premises environments.
2,314 questions
{count} votes