VSTS - 部署之前以应用的离线 [英] VSTS - Take app offline before deployment

查看:171
本文介绍了VSTS - 部署之前以应用的离线的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我得到使用VSTS持续部署到Azure这个问题。

I'm getting this problem using VSTS continuous deployment to azure

Web Deploy cannot modify the file 'XXX' on the destination because it is locked by an external process

在<一个提供的解决方案href=\"http://stackoverflow.com/questions/25813629/azurew-website-continious-deployment-web-deploy-cannot-modify-the-file-xxx-o\">this螺纹是手动重新启动我的蔚蓝的应用程序,但是他不会使用VSTS,并问2年前的问题,是这个问题固定在当前VSTS如果是这样,我想知道,因为我有同样的问题如上述引用的链接

the solution provided in this thread is to manually restart my app in azure, however he's not using VSTS and the question was asked 2 years ago, is this issue fixed on the current VSTS and if so, I would like to know how because I'm having the same problem as the link referenced above.

感谢

推荐答案

您可以使用EnableMSDeployAppOffline功能,按照这里的指令来部署之前您的应用程序设置为脱机:<一href=\"https://blogs.msdn.microsoft.com/webdev/2013/10/29/web-publishing-updates-for-app-offline-and-usechecksum/\"相对=nofollow> Web发布的更新的应用程序离线和usechecksum 。

You can use "EnableMSDeployAppOffline" feature to set your app offline before deployment by following the instruction here: Web publishing updates for app offline and usechecksum.

如果它不工作,你也可以创建一个PowerShell脚本如下停止应用程序,部署然后重新启动应用程序:

If it does not work, you can also create a PowerShell script as following to stop the app, deploy and then restart the app:

    param($websiteName, $packOutput)

    $website = Get-AzureWebsite -Name $websiteName

    # get the scm url to use with MSDeploy.  By default this will be the second in the array
    $msdeployurl = $website.EnabledHostNames[1]


    $publishProperties = @{'WebPublishMethod'='MSDeploy';
                            'MSDeployServiceUrl'=$msdeployurl;
                            'DeployIisAppPath'=$website.Name;
                            'Username'=$website.PublishingUsername;
                            'Password'=$website.PublishingPassword}

    Write-Output "Stopping web app..."
Stop-AzureWebsite -Name $websiteName

Write-Output "Publishing web app..."
$publishScript = "${env:ProgramFiles(x86)}\Microsoft Visual Studio 14.0\Common7\IDE\Extensions\Microsoft\Web Tools\Publish\Scripts\default-publish.ps1"

. $publishScript -publishProperties $publishProperties  -packOutput $packOutput

Write-Output "Starting web app..."
Start-AzureWebsite -Name $websiteName

PowerShell脚本来自:构建和部署ASP.NET 5应用到Azure的Web应用程序

这篇关于VSTS - 部署之前以应用的离线的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆