Remove a Listener from Application Gateway (and other components)

If you have provisioned an application gateway through the azure portal it’s not actually that easy to remove some components that get created automatically. As part of my testing, I ended up with a few Listeners that were surplus to requirement.

application gateway listeners - at the moment they cannot be deleted through the portal

application gateway listeners – at the moment they cannot be deleted through the portal

As a new service, the documentation isn’t that great yet. The following can be used to delete a listener from application gateway using powershell:

Remove Listeners

$AppGw = Get-AzureRmApplicationGateway -Name “application-gateway-name” -ResourceGroupName “application-gateway-resource”
Remove-AzureRmApplicationGatewayHttpListener -ApplicationGateway $AppGw -Name “name-of-listener-to-delete”
Set-AzureRmApplicationGateway -ApplicationGateway $AppGw

The process takes a wee while but will remove the listener. And for the following:

Remove HTTP Settings

$AppGw = Get-AzureRmApplicationGateway -Name “application-gateway-name” -ResourceGroupName “application-gateway-resource”
Remove-AzureRmApplicationGatewayBackendHttpSettings -ApplicationGateway $AppGw -Name “name-of-http-settings-to-delete”
Set-AzureRmApplicationGateway -ApplicationGateway $AppGw

Remove Back End Pools

$AppGw = Get-AzureRmApplicationGateway -Name “application-gateway-name” -ResourceGroupName “application-gateway-resource”
Remove-AzureRmApplicationGatewayBackendAddressPool -ApplicationGateway $AppGw -Name “name-of-back-end-pool-to-delete”
Set-AzureRmApplicationGateway -ApplicationGateway $AppGw

I’ll do a write up of the service once I have fully evaluated it. At this stage I’m not 100% sure what the difference is between this and Azure AD Application Proxy as the feature set overlaps a lot.

2 comments

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.