I try to set up a release pipeline for my Azure function. It's a v2 (.NET Core) project. Locally it works just fine, so I'd like to deploy it to Azure via DevOps.
I created the build pipeline with the standard steps (dotnet restore, dotnet build, etc.). It goes through fine and creates the artifact.
But I struggle to set up correctly the deployment. The pipeline has three tasks:
- Stop Azure App Service
- Deploy Azure App Service (I selected the Subscription,
Function Appas App type and the target App service). - Start Azure App Service
The second step fails, and I get the following error message:
Failed to deploy web package to App Service.
If I click on the more detailed log, I get this:
2019-02-04T02:25:43.4893738Z ##[error]Failed to deploy web package to App Service.
2019-02-04T02:25:43.4905786Z ##[error]Error: (2/4/2019 2:25:42 AM) An error occurred when the request was processed on the remote computer.
The content of azure-ci.yaml:
resources:
- repo: self
queue:
name: Hosted VS2017
steps:
- task: DotNetCoreCLI@2
displayName: Restore
inputs:
command: restore
projects: '$(Parameters.RestoreBuildProjects)'
- task: DotNetCoreCLI@2
displayName: Build
inputs:
projects: '$(Parameters.RestoreBuildProjects)'
arguments: '--configuration $(BuildConfiguration)'
- task: DotNetCoreCLI@2
displayName: Test
inputs:
command: test
projects: '$(Parameters.TestProjects)'
arguments: '--configuration $(BuildConfiguration)'
- task: DotNetCoreCLI@2
displayName: Publish
inputs:
command: publish
publishWebProjects: false
projects: '$(Parameters.RestoreBuildProjects)'
arguments: '--configuration $(BuildConfiguration) --output $(build.artifactstagingdirectory)'
- task: PublishBuildArtifacts@1
displayName: 'Publish Artifact'
inputs:
PathtoPublish: '$(build.artifactstagingdirectory)'
My questions are:
- What do I miss for the deployment task?
- Could it be something with the build pipeline? So the build artifact is "not in the right format", currently it's a ZIP file
- Do I need the separate stop / start tasks or they are included in the deployment already?
Not found PathtoPublish: D:\a\1\a\Release