Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
aappgw_hostnames
$TenantID = "123456abc-123abc-123abc-123abc-123456abc"
$SpokeSubscription = "123456abc-123abc-123abc-123abc-123456abc"
Connect-AzAccount -TenantId $TenantID -Subscription $SpokeSubscription
$rgName="rg-name"
$appgwName="appgw-name"
$gw=Get-AzApplicationGateway -Name $appgwName -ResourceGroupName $rgName
Foreach ($listeners IN $gw.HttpListeners)
{
if($listeners.HostNames.length -gt 0)
{
Write-Output "Listener Name"
$listeners.Name
Write-Output "Hostnames"
$listeners.HostNames
Write-Output " "
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment