Skip to content

Instantly share code, notes, and snippets.

@juanesech
Last active June 26, 2020 14:32
Show Gist options
  • Save juanesech/524b3813542834a04f559a56dc4139d2 to your computer and use it in GitHub Desktop.
Save juanesech/524b3813542834a04f559a56dc4139d2 to your computer and use it in GitHub Desktop.
<#
.SYNOPSIS
Delete default WAF settings.
.DESCRIPTION
This script deletes the default setting created when the WAF is deployed using building blocks.
.EXAMPLE
.\cleanWAF.ps1 -WAFName WAFTEST01
#>
param(
[Parameter(Mandatory=$true)]
[string]$SubscriptionName,
[string]$ResourceGroupName,
[string]$WAFName
)
$DefaultBackend = appGatewayBackendPool
$DefaultHTTPSettings = appGatewayBackendSettings-http
$DefaultListener = appGatewayListener-http
$DefaultRule = HTTP_rule
Set-AzContext -SubscriptionName $SubscriptionName
Remove-AzApplicationGatewayBackendHttpSetting -Name $DefaultHTTPSettings -ApplicationGateway $WAFName
Remove-AzApplicationGatewayHttpListener -Name $DefaultListener -ApplicationGateway $WAFName
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment