Azure Web App deploy: Web Deploy cannot modify the file on the destination because it is locked by an external process

前端 未结 11 827
甜味超标
甜味超标 2020-12-14 07:24

I am using the \"Azure Web App Deployment\" build step in VSTS to publish an ASP.NET Core API to an Azure Web App:

Occasionally, this step breaks with the f

11条回答
  •  渐次进展
    2020-12-14 08:24

    You can create two Power Shell scripts:

    stopapp.ps1:

    param($websiteName)
    $website = Get-AzureWebsite -Name $websiteName
    Stop-AzureWebsite -Name $websiteName
    

    startapp.ps1:

    param($websiteName)
    $website = Get-AzureWebsite -Name $websiteName
    Start-AzureWebsite -Name $websiteName
    

    And then add an "Azure PowerShell" task before and after "Azure Web App Deployment" task to stop the web app before deploy and start the app after deploy.

提交回复
热议问题