Restarting your Azure Application Gateway with PowerShell

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!"

About The Author

Leave a Comment

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

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Scroll to Top