在Azure App Service Task v3中使用Web Deploy时获取ERROR_FILE_IN_USE [英] Getting ERROR_FILE_IN_USE while using Web Deploy in Azure App Service Task v3

查看:64
本文介绍了在Azure App Service Task v3中使用Web Deploy时获取ERROR_FILE_IN_USE的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

类似的问题已经问了很多遍了,但是大多数答案都是过时的,可能仅部分适用.该问题特定于通过使用"Azure App Service Deploy"的Azure DevOps/Azure Pipelines使用Web Deploy.任务,版本3.*.

无法将Web程序包部署到App Service.

尝试在选中重命名锁定文件"选项的情况下再次部署应用程序服务.

错误代码:ERROR_FILE_IN_USE

更多信息:Web Deploy无法在目标上修改文件"VBCSCompiler.exe",因为该文件已被外部进程锁定.为了使发布操作成功,您可能需要重新启动应用程序以释放锁定,或者在下一次发布时对.Net应用程序使用AppOffline规则处理程序.试图.了解更多信息:

仅剩建议2:重新启动服务.由于许多原因,我宁愿不必退后一步.

为什么1和3不足以成功完成部署?

解决方案

我与一位Microsoft支持代表交谈,并被告知重命名锁定的文件"仅适用于DLL.

但是我确实找到了对我有用的解决方案.在其他参数"中,我添加了"-useChecksum".因此,"Deploy Azure App Service"任务现在看起来像这样

此后我没有任何问题.

Similar questions have been asked various times, but most answers are old and may only partially apply. This question is specific to using Web Deploy through Azure DevOps/Azure Pipelines using the "Azure App Service Deploy" task, version 3.*.

Failed to deploy web package to App Service.

Try to deploy app service again with Rename locked files option selected.

Error Code: ERROR_FILE_IN_USE

More Information: Web Deploy cannot modify the file 'VBCSCompiler.exe' on the destination because it is locked by an external process. In order to allow the publish operation to succeed, you may need to either restart your application to release the lock, or use the AppOffline rule handler for .Net applications on your next publish attempt. Learn more at: http://go.microsoft.com/fwlink/?LinkId=221672#ERROR_FILE_IN_USE.

There's two recommendations there:

  1. Select "Rename locked files" option
  2. Restart the application
  3. Use the AppOffline rule

Additionally, the documentation for the task reiterates recommendations 1 and 3 together.

For avoiding deployment failure with error code ERROR_FILE_IN_USE, in case of .NET apps targeting Web App on Windows, ensure that 'Rename locked files' and 'Take App Offline' are enabled. For zero downtime deployment use slot swap.

However, these recommendations are already in place.

All that's left is recommendation 2: restart the service. For many reasons, I rather not have to fall back to this.

Why are 1 and 3 not enough to complete the deployment successfully?

解决方案

I spoke with a Microsoft support rep and was told that "Rename locked files" only works for DLLs.

But I did find a solution that did work for me. In "Additional arguments", I added "-useChecksum". So the "Deploy Azure App Service" task now looks like this

I haven't had any problems since.

这篇关于在Azure App Service Task v3中使用Web Deploy时获取ERROR_FILE_IN_USE的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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