Created
June 16, 2022 11:51
-
-
Save JohnLBevan/a4779e4d488bde5d266eb5630b6dc271 to your computer and use it in GitHub Desktop.
A kusto query which can be run under the Azure Resource Graph Explorer (https://portal.azure.com/#view/HubsExtension/ArgQueryBlade) to get a list of hostnames/listeners configured on all app gateways under your subscriptions.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
( | |
resourcecontainers | |
| where type =~ 'microsoft.resources/subscriptions' | |
| project SubscriptionName=name, subscriptionId | |
) | join kind = inner | |
( | |
resources | |
| where type =~ 'microsoft.network/applicationgateways' | |
| project subscriptionId, AppGateway=name, httpListeners = properties['httpListeners'] | |
) on subscriptionId | |
| mv-expand httpListeners | |
| project SubscriptionName | |
, AppGateway | |
, Listener = httpListeners.name | |
, Protocol = httpListeners.properties.protocol | |
, SingleHostName = httpListeners.properties.hostName | |
, HostNames = httpListeners.properties.hostNames | |
| mv-expand HostName = coalesce(SingleHostName, HostNames) | |
| project-away SingleHostName, HostNames |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment