部署失败,错误:使用zip部署失败的软件包部署。请参阅日志以获取更多详细信息

发布于 2025-01-29 21:26:29 字数 199 浏览 4 评论 0原文

我正在尝试使用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.

Error Screenshot

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(9

困倦 2025-02-05 21:26:29

您可以尝试以下解决方案来解决此问题:

  1. 如果使用VS代码,请使用vs code azure工具扩展名

  2. 在应用程序服务中 - >转到“部署中心”刀片,然后单击顶部的“断开连接”按钮。
    在此之后,重新运行释放管道。

You can try the following workarounds to resolve this issue:

  1. If you are using the VS code then use the VS Code Azure Tool Extension.

  2. In App service -->go to the "Deployment Center" blade, and click on the "Disconnect" button on top.
    After that re-run the release pipeline.

说不完的你爱 2025-02-05 21:26:29

我在门户和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:

enter image description here

The way to fix it was to add a setting in the configuration: ( and remembering to hit save )

enter image description here

After that, the github action runs correctly without any errors.

enter image description here

雨后彩虹 2025-02-05 21:26:29

在Azure UI中,您可以在环境变量

websity_run_from_package = 1

In Azure UI you can set this up in your Environment variables

WEBSITE_RUN_FROM_PACKAGE = 1

enter image description here

隔岸观火 2025-02-05 21:26:29

对我来说,它是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.

铁憨憨 2025-02-05 21:26:29

@nmishr的回答为我解决了。

如果部署为zip(例如,从管道中),并使用二头肌,我添加了以下应用程序设置:

resource myWebApp 'Microsoft.Web/sites@2022-09-01' = {
  ...
  properties: {
    ...
    siteConfig: {
      ...
      appSettings: [
        ...
        {
          name: 'WEBSITE_RUN_FROM_PACKAGE'
          value: '1'
        }
      ]
    }
  }
}

@nmishr's answer solved it for me.

If deploying as ZIP (e.g. from pipelines), and using bicep, I added the following app setting:

resource myWebApp 'Microsoft.Web/sites@2022-09-01' = {
  ...
  properties: {
    ...
    siteConfig: {
      ...
      appSettings: [
        ...
        {
          name: 'WEBSITE_RUN_FROM_PACKAGE'
          value: '1'
        }
      ]
    }
  }
}

酒浓于脸红 2025-02-05 21:26:29

我在输出日志上伴随着其他几条消息。
其他消息之一是:

上传构建的内容时畸形的SCM_RUN_FROM_PACKAGE。

另一个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:

Malformed SCM_RUN_FROM_PACKAGE when uploading built content.

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.

极度宠爱 2025-02-05 21:26:29

当尝试从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.

标点 2025-02-05 21:26:29

对我来说,为我的Web应用程序设置这两个环境变量都解决了问题。没有它们,Azure Pipeline任务Azurewebapp@1需要40分钟,然后失败。

{
  name: 'ENABLE_ORYX_BUILD'
  value: '0'
}
{ name: 'WEBSITE_RUN_FROM_PACKAGE', value: '1' }

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.

{
  name: 'ENABLE_ORYX_BUILD'
  value: '0'
}
{ name: 'WEBSITE_RUN_FROM_PACKAGE', value: '1' }
爱给你人给你 2025-02-05 21:26:29

在功能应用程序门户网站中,转到“部署中心”刀片,然后单击“断开连接”按钮。

在此之后,在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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文