简体   繁体   中英

Azure function app deploy and release pipeline error

I pushed my .net core function application using visual studio and now setting up release pipeline. I can publish and execute the application just fine and it works great on the Azure portal. However when I see the builds for releases in azure-devOps that slot fails with the following error.

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)

Under tasks

App type is Function App on 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

According to the error message:

Deployment of msBuild generated package is not supported. Change package format or use Azure App Service Deploy task.

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.

Azure App Service Deploy task :

Use this task in a build or release pipeline to deploy to a range of App Services on Azure. The task works on cross-platform agents running Windows, Linux, or Mac and uses several different underlying deployment technologies.

The task works for ASP.NET, ASP.NET Core, PHP, Java, Python, Go, and Node.js based web applications.

The task can be used to deploy to a range of Azure App Services such as:

  • Web Apps on both Windows and Linux

  • Web Apps for Containers Function

  • Apps on both Windows and Linux

  • Function Apps for Containers

  • WebJobs

  • Apps configured under Azure App Service Environments

Check this blog Visual Studio 2017 Tools for Azure Functions and Continuous Integration with VSTS for some more details.

Hope this helps.

I get predefined pipeline from VS integration. So for those you have the same case:

  1. In GUI/Classic mode Release page -> edit pipeline
  2. Edit task in stage section (this is responsible for deploying) 在此处输入图片说明
  3. Replace Azure Web App task with Azure App Service deploy在此处输入图片说明

I have more than one project (web api + azure function) in my solution. For the web app I used the zip file, but for the azure function to work I needed to publish the whole folder.

Azure Function Package or folder: $(System.DefaultWorkingDirectory)/_Backend/drop

Web Api Package or folder: $(System.DefaultWorkingDirectory)/_Backend/drop/ClientAPI.zip

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM