Hi,
Seems you have authorization problem. Are you sure that the account you have logged to execute that get operation has read permissions for the scope?
How do I retrieve azure monitor metric alerts through Metric Alert - Get API?
I am using the below mentioned API to get the metric alerts (under Azure Monitor) that I created through Azure Portal.
In the azure monitor section, under Alerts I can see there are 4 alerts, but I am not able to fetch their information through the API. It is giving me this error:
{
"error": {
"code": "AuthorizationFailed"
"message": "The client {client id} with object id {object id} does not have authorization to perform action 'Microsoft.Insights/metricAlerts/read' over scope '/subscriptions/{SubscriptionID}/resourceGroups/{Resource Group name}/providers/Microsoft.Insights/metricAlerts/{rule name}' or the scope is invalid. If access was recently granted, please refresh your credentials."
}
}
Also can you please let me know if there is a latency in getting the metric alert data through the API?
1 answer
Sort by: Most helpful
-
Stanislav Zhelyazkov 21,101 Reputation points MVP
2021-04-01T13:35:50.557+00:00