Error When Adding Azure Monitor Data Source


#1

Hi there!

Has anybody had issues creating a new Azure Monitor data source?

I think there’s a bug with the plugin getting the Client Id info (which is the Application ID).

I’m getting an error "

  1. Azure Monitor: AuthorizationFailed. The client ‘*** NO IDEA WHERE IT IS PULLING THIS INFO FROM***’ with object id ‘*** NO IDEA WHERE IT IS PULLING THIS INFO FROM***’ does not have authorization to perform action ‘Microsoft.Resources/subscriptions/resourceGroups/read’ over scope ‘/subscriptions/*** THIS IS PULLING THE CORRECT INFO***’. 2. Successfully queried the Application Insights service.

#2

I figured out the problem. I needed to add my App ID permissions.


#3

For anyone else who finds this. I had a similar problem after creating a new subscription. I had to recreate the App Registration under Azure Active Directory using the Azure CLI to get the correct permissions (was not able to set the correct permissions in the portal).

az ad sp create-for-rbac -n "http://yourname.grafana.net"

#4

If after pressing [Save & Test] on your Azure Monitor Data Source you find yourself faced with the following message :-


  1. Azure Monitor: AuthorizationFailed. The client ‘xxxxxx-xxxxxxx-xxxxxxx-xxxxxxxxx’ with object id ‘xxxxxx-xxxxxxx-xxxxxxx-xxxxxxxxx’ does not have authorization to perform action ‘Microsoft.Resources/subscriptions/resourceGroups/read’ …

Just open up a Cloud Shell (CLI 2.0) from within Azure and give ‘xxxxxx-xxxxxxx-xxxxxxx-xxxxxxxxx’ read permissions using the following command :-

az role assignment create --assignee xxxxxx-xxxxxxx-xxxxxxx-xxxxxxxxx --role Reader

Further reading can be found here:-


#5

I will add this to the Azure Monitor plugin docs too. For me, it was extremely frustrating trying to find how to set this via the Azure portal. This is a far simpler solution.


#6

In case it helps someone, I was getting the same error even after adding the Reader role assignment. I thought I would just restart Grafana on the hopes that it may help. As soon as I restarted Grafana, I was able to use the new Azure Monitor data source without error. Not sure why that would help but it did.

Ed