Skip to content

Instantly share code, notes, and snippets.

@jikuja
Created December 30, 2024 12:59
Show Gist options
  • Save jikuja/6351cabfbf6b1f3145be17f3511bf332 to your computer and use it in GitHub Desktop.
Save jikuja/6351cabfbf6b1f3145be17f3511bf332 to your computer and use it in GitHub Desktop.
ARG
resources
| where array_length(properties.privateEndpointConnections) > 0
| project resourceId = id, resourceName = name, resourceEnum = type, connection = properties.privateEndpointConnections, resourceLocation = location, resourceSubscriptionId = tolower(subscriptionId)
| mvexpand connection // usually just removes array wrapper from connection
| extend id = connection.id| extend name = tostring(split(id, "/")[10])
| extend privateEndpointId = connection.properties.privateEndpoint.id
| extend privateEndpointSubscriptionId = tolower(split(connection.properties.privateEndpoint.id, "/")[2])
| extend endpointName = tostring(split(privateEndpointId, "/")[8])
| extend description = tostring(connection.properties.privateLinkServiceConnectionState.description)
| extend status = connection.properties.privateLinkServiceConnectionState.status
| join kind=leftouter (
resourcecontainers
| where ['type'] == "microsoft.resources/subscriptions"
| project subscriptionId = tolower(subscriptionId), subscriptionName = name
) on $left.privateEndpointSubscriptionId == $right.subscriptionId
|where subscriptionName == ""
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment