azure-devopsasp.net-core-webapi.net-core-3.1azure-appservicevisual-studio-publish

.NET Core 3.1 API fails when using DevOps CI/CD


Deploying a .NET Core 3.1 API Application to an Azure WebApp fails when using DevOps CI/CD Release Pipeline but succeeds when Publishing from Visual Studio

Create .NET Core 3.1 Api App

enter image description here

enter image description here

enter image description here

enter image description here

Create Azure Web App

Create a new resource of type “Web App”

enter image description here

enter image description here

Publish from Visual Studio

enter image description here

enter image description here

enter image description here

enter image description here

enter image description here

Ok, so that works, now here's what happens when trying to deploy using DevOps CI/CD Release Pipeline..

Deploy via DevOps CI/CD

… create another Web App resource junk-devops-cicd ...

enter image description here

deploy via ci/cd pipeline

enter image description here

Create the Build Pipeline

enter image description here

enter image description here

enter image description here

enter image description here

enter image description here

enter image description here

Create the Release Pipeline

enter image description here

enter image description here

enter image description here

enter image description here

enter image description here

enter image description here

enter image description here

enter image description here

enter image description here

enter image description here

enter image description here

enter image description here

enter image description here

enter image description here

enter image description here

enter image description here

enter image description here

enter image description here

enter image description here

So it fails going through CI/CD pipeline. But not VS Publish Manager

enter image description here


Solution

  • Your .net core application build task is wrong. i guess solution is not getting build successfully . try visualstudio build instead of netBuild enter image description here

    And make sure your Artifact Build directory path been set correctly. root path should be $(Build.ArtifactStagingDirectory)