AzureMonitor data source cannot get access to azure

I’m getting following error:

Azure Monitor: Unauthorized: AuthenticationFailedMissingToken. Authentication failed. The ‘Authorization’ header is missing the access token.

I’ve generated the api key and passed it as a header as follows:

Authorization: Bearer

but the error still appears.

The azure monitor data source is deployed via curl and when I check for it with /api/datasources, I can see that all fields for client secret, tenant id, client id are populated.

The only thing that works is that when I manually paste the client secret to the corresponding field. The error then disappears and it works even without using generated api key.

Anyone has a clue what may be wrong here?