In some situations, we need to restart the Azure Application Gateway. Unfortunately, we don’t have an easy-to-click restart button for this task using Azure Portal.
The following code can be used to restart any provided Application Gateway name in your subscription. Make sure that you are in the right subscription when using PowerShell.
$appGWName = Read-Host "Application Gateway name?" If (Get-AzApplicationGateway | where-object {$_.Name -eq $appGWName}) { $appGW = Get-AzApplicationGateway | where-object {$_.Name -eq $appGWName} Write-Host "Stopping the $appGWName ..." Stop-AzApplicationGateway -ApplicationGateway $appgw Write-Host "Starting the $appGWName ..." Start-AzApplicationGateway -ApplicationGateway $appgw } Else { Write-Host "Application Gateway not found!" }