Add option to stop website before deploying

cloud

(geert) #1

At the moment I am having some issues deploying an Azure Web App (asp.net core). I always get the error that some files are locked by a process. Then I have to go to the Azure portal, stop the website (with the right slot) and retry.

Now I have solved this by adding this powershell script before the actual deployment:

Stop-AzureRmWebAppSlot -ResourceGroup "#{AzureResourceGroupName}" -Name "#{AzureWebsiteName}" -Slot "#{DeploymentSlot}"

Could something like this be added as an option to the “Deploy Azure Web App”, this step is aware of the slot, resource group and website name anyway.

Thanks!


(Mark Siedle) #3

Hi Geert,

Thanks for getting in touch.

We think this is a good idea. We’ve noticed that even if you restart your web-app (right before you deploy to it), Azure may still have files locked causing your deployment to fail, so the only sure way is what you’ve been doing: Stop -> Deploy -> Start.

We’ve added an internal card to investigate this as a feature on the Azure Web App step.

Cheers
Mark


(Mark Siedle) #4

Hi again Geert,

Another option that may be worth trying is the “Enable AppOffline” flag on the Azure Web App step. This flags gets sent through to WebDeploy as one of the deployment sync options, and is supposed to safely bring down the app domain before your deployment occurs. So this may also solve the problem of deploying to locked files during deployment.

Let me know how you go.

Cheers
Mark