Sandro and I have talked a few times about how to check which API Connections are broken and have had a few ideas about different ways to do this. Today I needed to check again if my SharePoint connector is disconnected and I wondered if there is an easy way to do this with Azure Resource Graph and it turns out there is.

The below query will give you a list of any connections which are not in the connected state.

Resources
| where type =~ 'MICROSOFT.WEB/connections'
and resourceGroup =~ 'EAI-Prod'
| extend overallStatus = tostring(parse_json(properties).overallStatus)
| extend displayName = tostring(parse_json(properties).displayName)
| where overallStatus != 'Connected'
| project name, displayName, id, overallStatus

Automating it

If you check out the below article there is an example of automating a graph query

https://docs.microsoft.com/en-gb/azure/governance/resource-graph/tutorials/logic-app-calling-arg

 

Buy Me A Coffee