简体   繁体   English

Azure 函数应用部署和发布管道错误

[英]Azure function app deploy and release pipeline error

I pushed my .net core function application using visual studio and now setting up release pipeline.我使用 Visual Studio 推送了我的 .net 核心功能应用程序,现在正在设置发布管道。 I can publish and execute the application just fine and it works great on the Azure portal.我可以很好地发布和执行应用程序,它在 Azure 门户上运行良好。 However when I see the builds for releases in azure-devOps that slot fails with the following error.但是,当我在 azure-devOps 中看到版本的构建时,该插槽失败并出现以下错误。

2019-06-19T23:21:33.3543380Z ##[error]Error: Deployment of msBuild generated package is not supported. Change package format or use Azure App Service Deploy task. D:\a\r1\a\_...AVFunctionCore.zip

I am not sure where I need to check in my setup to even start diagnosing the issue.我不确定我需要在哪里检查我的设置才能开始诊断问题。

Here are the pipeline steps.这是管道步骤。 I create a new stage and then select a template of type (Azure app service deployment)我创建一个新阶段,然后选择类型模板(Azure 应用服务部署)

Under tasks任务下

App type is Function App on Windows应用程序类型是 Windows 上的函数应用程序

Give the app name, resource group , give the slot and package folder as给应用程序名称,资源组,给插槽和包文件夹作为

 $(System.DefaultWorkingDirectory)/**/AVFunctionCore.zip

Everything else on this is left as default.其他所有内容都保留为默认值。

Azure function app deploy and release pipeline error Azure 函数应用部署和发布管道错误

According to the error message:根据错误信息:

Deployment of msBuild generated package is not supported.不支持部署 msBuild 生成的包。 Change package format or use Azure App Service Deploy task.更改包格式或使用 Azure 应用服务部署任务。

It seems you are not using the correct task to publish the generated package.您似乎没有使用正确的任务来发布生成的包。 Since the generated package is .zip , you can try the suggestion as error message said use Azure App Service Deploy task.由于生成的包是.zip ,您可以尝试建议作为错误消息说使用 Azure 应用服务部署任务。

Azure App Service Deploy task : Azure 应用服务部署任务

Use this task in a build or release pipeline to deploy to a range of App Services on Azure.在生成或发布管道中使用此任务部署到 Azure 上的一系列应用服务。 The task works on cross-platform agents running Windows, Linux, or Mac and uses several different underlying deployment technologies.该任务适用于运行 Windows、Linux 或 Mac 的跨平台代理,并使用多种不同的底层部署技术。

The task works for ASP.NET, ASP.NET Core, PHP, Java, Python, Go, and Node.js based web applications.该任务适用于基于 ASP.NET、ASP.NET Core、PHP、Java、Python、Go 和 Node.js 的 Web 应用程序。

The task can be used to deploy to a range of Azure App Services such as:该任务可用于部署到一系列 Azure 应用服务,例如:

  • Web Apps on both Windows and Linux Windows 和 Linux 上的 Web 应用程序

  • Web Apps for Containers Function容器功能的 Web 应用程序

  • Apps on both Windows and Linux Windows 和 Linux 上的应用程序

  • Function Apps for Containers容器功能应用

  • WebJobs网络工作

  • Apps configured under Azure App Service Environments在 Azure 应用服务环境下配置的应用

Check this blog Visual Studio 2017 Tools for Azure Functions and Continuous Integration with VSTS for some more details.查看此博客Visual Studio 2017 Tools for Azure Functions and Continuous Integration with VSTS了解更多详细信息。

Hope this helps.希望这可以帮助。

I get predefined pipeline from VS integration.我从 VS 集成中获得了预定义的管道。 So for those you have the same case:所以对于那些你有同样情况的人:

  1. In GUI/Classic mode Release page -> edit pipeline在 GUI/经典模式下发布页面 -> 编辑管道
  2. Edit task in stage section (this is responsible for deploying)在阶段部分编辑任务(这负责部署) 在此处输入图片说明
  3. Replace Azure Web App task with Azure App Service deploy使用Azure App Service deploy替换Azure Web App任务在此处输入图片说明

I have more than one project (web api + azure function) in my solution.我的解决方案中有多个项目(web api + azure 函数)。 For the web app I used the zip file, but for the azure function to work I needed to publish the whole folder.对于 Web 应用程序,我使用了 zip 文件,但要使 azure 功能正常工作,我需要发布整个文件夹。

Azure Function Package or folder: $(System.DefaultWorkingDirectory)/_Backend/drop Azure 函数包或文件夹:$(System.DefaultWorkingDirectory)/_Backend/drop

Web Api Package or folder: $(System.DefaultWorkingDirectory)/_Backend/drop/ClientAPI.zip Web Api 包或文件夹:$(System.DefaultWorkingDirectory)/_Backend/drop/ClientAPI.zip

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Azure Devops Release Pipeline - 将单个文件部署到Azure App Service - Azure Devops Release Pipeline - Deploy single file to Azure App Service 如何通过 CI/CD 管道将 Azure 函数部署到函数应用中? - How to deploy an Azure function into a function app through a CI/CD pipeline? Azure YAML 管道:部署到 Function 应用程序而不覆盖现有的 function - Azure YAML Pipeline: deploy to Function App without overwriting existing function 部署到 AWS EC2 的 Azure 发布管道 - Azure Release Pipeline to deploy to AWS EC2 在Azure版本管道上使用部署脚本 - Use deploy script on Azure release pipeline 发布没有应用程序服务的Azure功能的发布管道(用于消费计划) - Release pipeline for Azure Function without app service (For consumption plan) 无法使用 pipeline.yml 文件部署 azure 函数应用 - Unable to deploy azure function app using pipeline.yml file 使用 Jenkins Pipeline 将 PHP 部署到 Azure Web App 时出错 - Error when Deploy PHP to Azure Web App using Jenkins Pipeline Azure Devops 发布管道无法将 Web 包部署到应用服务。 禁止IP 403 - Azure Devops release pipeline Failed to deploy web package to App Service. Ip Forbidden 403 是否可以在我的发布管道中使用 Azure 经典服务连接来部署应用服务? - Is it possible to use an Azure Classic Service Connection in my Release pipeline to deploy App Service?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM