Adriano Rocha
Adriano Rocha

Reputation: 29

How to force an Azure WebApp to restart after each deploy?

I have a Web Application (Java) running on Azure. Every time we deploy it (via ARM template deployment) we have to restart it manually to make it work. Is there any setting to restart it automatically after each deployment?

SOLUTION: Just added a Azure Powershell task at the end of my relase pipeline with the command: Restart-AzureRmWebApp -ResourceGroupName xxx -Name xxx

Upvotes: 2

Views: 2255

Answers (2)

DaveC
DaveC

Reputation: 73

We use the Azure CLI version

az login ...
az webapp restart --name "${{ env.WEB_APPNAME }}" \
    --resource-group "${{ env.RESOURCE_GROUP_NAME }}"

Agreed it should not be necessary, or the action itself should support a "restart" command.

Upvotes: 0

Martin Brandl
Martin Brandl

Reputation: 58931

I'm not aware of an ARM configuration to automatically restart the app after the deployment. However, you could consider using the Restart-AzWebAppSlot PowerShell cmdlet after your deployment to restart it.

Upvotes: 1

Related Questions