Forum Discussion
Log Analytics / App Insights permissions
- Nov 18, 2019
HiJK_UK
To be more precise I have written a blog post about alerts API:
https://cloudadministrator.net/2019/10/07/azure-monitor-alert-series-part-7/
If you scroll to the bottom there is example and on line 44-48 you will see that resources (log analytics workspace or application insights instance) needs to be added with their resource IDs. As far as I know that information is not available trough the portal so you will have to check the ARM API to get it and see if the mentioned app insights instance is added to that part of the properties. Authorized resources part is used when you do cross workspace/app insights queries for alerts.
Hi Stanislav, thanks for the reply.
The Resource is a Log Analytics instance:
The alert is just a log query running the following (purely as a test)
app('uniweb-dev').customMetrics
This should work shouldn't it ? In fact, I've got instances in my dev environment where this works. The difference is is that the environment I'm trying to get this to work in is a lot more complicated.
I'm just about to try redeploying the alert but this time set the Resource at the top as the Application Insights instance. Then the query presumably would just need to be:
customMetrics
I'll keep you posted.
HiJK_UK
To be more precise I have written a blog post about alerts API:
https://cloudadministrator.net/2019/10/07/azure-monitor-alert-series-part-7/
If you scroll to the bottom there is example and on line 44-48 you will see that resources (log analytics workspace or application insights instance) needs to be added with their resource IDs. As far as I know that information is not available trough the portal so you will have to check the ARM API to get it and see if the mentioned app insights instance is added to that part of the properties. Authorized resources part is used when you do cross workspace/app insights queries for alerts.
- JK_UKNov 18, 2019Brass Contributor
Thanks!
That's exactly what it was, I'd never noticed the authorizedResources value before. Burst into life once I'd added the app insight resourceId in there!
Thanks again.