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

前端 未结 11 801
甜味超标
甜味超标 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:21

    Eddie's answer was close to what I needed, the only thing that was missing was a way to specify the deployment slot:

    stopapp.ps1

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

    startapp.ps1

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

    And then on your Azure PowerShell task Script Arguments could be something like this:

    -websiteName "{mywebsite}" -websiteSlot "{mydeploymentslot}"
    

提交回复
热议问题