azureazure-log-analyticsazure-monitor

does not have authorization to perform action 'microsoft.insights/logs/read' over scope


While creating a "Custom log search" alert in Azure Monitor, I'm receiving the following error when the query editor loads:

Failed to retrieve schema. Please try to refresh the page. The client 'blah@msft.com' with object id 'f771d999-7f9e-46dd-9f29-ce11b77aa64e' does not have authorization to perform action 'microsoft.insights/logs/read' over scope '/subscriptions/f8ec86a6-6797-4f4e-bf4f-45881d57a16f/providers/microsoft.insights/logs/metadata' or the scope is invalid. If access was recently granted, please refresh your credentials.

What permission(s) need to change? And what resource does 'microsoft.insights' correspond to? 🤔


Solution

  • What permission(s) need to change?

    In Access Control (IAM) of the subscription, add the requesting user to the Log Analytics Reader role

    screenshot of IAM on subscription

    Role name: Log Analytics Reader
    Role desc: Log Analytics Reader can view and search all monitoring data as well as and view monitoring settings, including viewing the configuration of Azure diagnostics on all Azure resources.


    what resource does 'microsoft.insights' correspond to?

    Apparently Microsoft.Insights is Azure Monitor (source)