部署失败,错误:使用zip部署失败的软件包部署。请参阅日志以获取更多详细信息
我正在尝试使用git将代码部署到Azure应用程序服务。但是我遇到了错误:“部署失败失败:使用zip部署失败的软件包部署。有关更多详细信息,请参阅日志”。它在2天前正常工作,但突然它开始崩溃。
日志中没有任何帮助。
I am trying to deploy my code to azure app service using git. But I am getting error "deployment Failed with Error: Package deployment using ZIP Deploy failed. Refer logs for more details". It was working perfectly 2 days back, but suddenly it starts crashing.
There is nothing helpfull in the logs.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(9)
您可以尝试以下解决方案来解决此问题:
如果使用VS代码,请使用
vs code azure工具扩展名
。在应用程序服务中 - >转到“部署中心”刀片,然后单击顶部的“断开连接”按钮。
在此之后,重新运行释放管道。
You can try the following workarounds to resolve this issue:
If you are using the VS code then use the
VS Code Azure Tool Extension
.In App service -->go to the "Deployment Center" blade, and click on the "Disconnect" button on top.
After that re-run the release pipeline.
我在门户和VS代码中创建了一个功能应用程序,然后尝试通过GitHub Action部署。我能够回顾一下它无法通过以下错误部署到门户中的函数应用程序:
修复它的方法是在配置中添加设置: )
之后,github操作正确地运行而没有任何错误。
I created a function app both in the portal and in VS code then tried deploying via github action. I was able to repro that it fails to deploy to the function app create in the portal with the following errors:
The way to fix it was to add a setting in the configuration: ( and remembering to hit save )
After that, the github action runs correctly without any errors.
在Azure UI中,您可以在
环境变量
websity_run_from_package = 1
In Azure UI you can set this up in your
Environment variables
WEBSITE_RUN_FROM_PACKAGE
=1
对我来说,它是
enable_oryx_build
flag(在应用程序服务配置中),由于某种原因,它在新创建的函数上启用。在禁用后,我设法找到了一个原因。我的应用程序的要求无法安装,这就是为什么构建失败的原因。
For me it was
ENABLE_ORYX_BUILD
flag (in App Service Configuration) which was enabled on newly created function for some reason. I managed to find a reason after I've disabled it.The requirements of my app failed to install and that's why build was failing.
@nmishr的回答为我解决了。
如果部署为zip(例如,从管道中),并使用二头肌,我添加了以下应用程序设置:
@nmishr's answer solved it for me.
If deploying as ZIP (e.g. from pipelines), and using bicep, I added the following app setting:
我在输出日志上伴随着其他几条消息。
其他消息之一是:
有另一个stackoverflow主题试图解决此错误。
当我尝试通过Azure Portal创建功能应用程序,然后将本地开发的函数上传到该功能应用程序时,我会得到这些错误。
我的解决方案是使用VSCODE Azure扩展名直接通过VSCODE创建函数应用程序。
也许此解决方案对于应用程序服务也相同。
I got this error accompanied by several other messages on the output log.
One of the other messages was:
There is another StackOverflow topic which tries to solve this error.
When I tried to create a Function App through Azure Portal and then upload locally developed Functions to that Function App, I would get these errors.
My solution was to create the Function App through VSCode directly, using the VSCode Azure Extension.
Maybe this solution will work the same for App Services.
当尝试从VSCODE内的Azure扩展名重新部署时,我连续两次遇到此错误。在首次停止应用程序服务后,我一直在尝试部署。当我启动应用程序服务时,然后运行部署,它可以正常运行,没有错误。
我不知道那是解决方案还是背景中发生的其他事情,因为每次我部署到Azure时,我都会得到不同/新的错误或问题以要克服,但是无论如何这都会对某人有所帮助。
I got this error twice in a row when attempting to re-deploy from the Azure extension within VSCode. I had been attempting the deployment after first stopping the app service. When I started the app service, then ran the deployment, it worked OK with no error.
I don't know whether that was the solution or whether something else happened in the background, because every time I deploy to Azure I get a different/new error or issue to overcome, but maybe this will help someone anyway.
对我来说,为我的Web应用程序设置这两个环境变量都解决了问题。没有它们,Azure Pipeline任务Azurewebapp@1需要40分钟,然后失败。
For me, setting both of these environmental variables for my Web App solved the issue. Without them, the Azure Pipeline task AzureWebApp@1 was taking 40 minutes and then just failing.
在功能应用程序门户网站中,转到“部署中心”刀片,然后单击“断开连接”按钮。
在此之后,在Azuredevops中重新运行管道/释放。
In the Function App portal, go to the "Deployment Center" blade, then click on the "Disconnect" button.
After that re-run the pipeline/release in AzureDevOps.