skip to Main Content

I want to list all app insights with no workspace IDs.

I run the following Azure Resource Graph query but am not sure if it displays all app insights with and without workspace ids. I really need to check if there are any app insights with NO workspace ids

resources
| where type == "microsoft.insights/components"
| where properties[‘WorkspaceResourceId’] == ""

2

Answers


  1. Your query works fine, I doublechecked in my lab as I’ve just been busy migrating some old application insights to the new workspace enabled ones. If you want you can also add the resourcegroup for easy locating the resources in case you have a large environment:

    resources
    | where type == "microsoft.insights/components" 
    | where properties['WorkspaceResourceId'] == ""
    | join kind=inner (
        resourcecontainers
        | where type == 'microsoft.resources/subscriptions'
        | project subscriptionId, subscriptionName = name)
        on subscriptionId
    | project name, type, subscriptionName, resourceGroup
    | order by subscriptionName asc
    
    Login or Signup to reply.
  2. Run this query in Azure Resource Graph Explorer:

    resources
    | where type == "microsoft.insights/components"
    | extend IngestionMode = tostring(properties.IngestionMode)
    | summarize count() by IngestionMode
    

    You’ll get something like this. Anything non LogAnalytics is classic (i.e., without workspaceId).

    enter image description here

    To get full list of Classic resources run this query:

    resources
    | where type == "microsoft.insights/components"
    | extend IngestionMode = tostring(properties.IngestionMode)
    | where IngestionMode != "LogAnalytics"
    | order by id
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search