Error while deploying release pipeline in Azure Devops - azure-devops

I am trying to deploy an existing .Net Core application using Azure Devops by creating Build and release pipelines. The build pipeline worked fine, but I get the below error when running the release pipeline (under Deploy Azure App Service).
Error: No package found with specified pattern: D:\a\r1\a***.zipCheck if the package mentioned in the task is published as an artifact in the build or a previous stage and downloaded in the current job.
What should be done to fix this?

This error is because the build task is not configured. You can try to put the below YAML code at the last to make it work.
- task: PublishBuildArtifacts#1

Related

Azure pipeline build artifacts for previous builds

We have a .NET ASP Web form application. Currently we use TeamCity for the CI part. Deployment part is manual. We take the build artifact generated by TeamCity and deploy the artifact manually.
Now we will be using Azure DevOps for complete CICD process. During the POC we have been able to successfully build and deploy the application in IIS. I am new to the azure pipeline and doing POCs to learn it.
In TeamCity, against each build the generated build artifacts are available. So we can easily refer to any specific build and get the build artifact for that specific build. This is useful in case of rollback. We take the last successfully build artifacts and deploy the same in case of any error.
But in Azure is there any build artifacts repository where we can get the all the build artifacts for all the builds of that pipeline ? There is a section "Artifacts" but as per my knowledge this is for publishing as packages across feeds.
Now I have come across JFrog artifact repository https://jfrog.com/artifactory/. But no nothing about this. Need to go through.
Anyone can please let me know , in azure pipelines , where I can get all the build artifacts against all the builds in a pipeline. Is it available against each run in the pipeline or I need to configure it somehow ?
In any release failure , I need to rollback to the last successful deployed artifact version.
Thanks in advance for any guidance on this.
Azure Artifacts is feed source for packages like nuget etc.
And build/pipeline artifact you can find in your build here (of course if you published them):
Here you have documentation about publishing and downloading pipeline artifacts - newer and recommended approach and here about build artifacts
In short what you needs is add this step:
- task: PublishPipelineArtifact#0
displayName: 'Publish pipeline artifacts'
inputs:
targetPath: $(Build.ArtifactStagingDirectory)/
archiveFilePatterns: '**/*.zip'
Of course if your pipeline output is a nuegt package you can publish it to Azure Artifacts.

.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
Create Azure Web App
Create a new resource of type “Web App”
Publish from Visual Studio
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 ...
deploy via ci/cd pipeline
Create the Build Pipeline
Create the Release Pipeline
So it fails going through CI/CD pipeline. But not VS Publish Manager
If the first pipeline you created is a CI pipeline (Build pipeline) you need to select the "ASP .net" template not the "Azure web App". this pipeline will restore nuget,build and publish the artifact of your app in the artifact store of AzureDevops. Then your release pipeline will get this artifact and deploy it into Azure.
the "Azure web App" template is a CI/CD template.
I think the mistake you have mad is deleting some essentials steps for building a package, "Use Nuget" and "Nuget restore".
To build an artifact correctly you need to have those steps:
Asp .net build pipline
Your .net core application build task is wrong. i guess solution is not getting build successfully . try visualstudio build instead of netBuild
And make sure your Artifact Build directory path been set correctly. root path should be $(Build.ArtifactStagingDirectory)

AzureDevops build step passed even when Octopus build failed due to space issue on server

We are using AzureDevops integrated with Octopus Deploy. Currently, Create octopus release step in AzureDevops showed as passed even when it failed in Octopus due to space issue on server. Any idea how to force AzureDevops to show this as failed step as well.
I think the issue here is that Azure DevOps pushes the packages to Octopus, and you've created the release but not asked it to check in on the status of the deployment.
I have an Azure pipeline building, packaging and pushing to Octopus and it looks like the below:
Azure DevOps Pipeline
I have it create an Azure Release which deals with Creating the Release, Deploying to Dev, Test and lastly Production as below:
Azure DevOps Release Pipeline
I'd recommend in your Create Release and Deploy step to "Show Deployment Process" as this will pipe the logs from Octopus to Azure DevOps and mark the Azure DevOps job appropriately. Box below:
Azure DevOps Show Deployment Process button
Please let me know how you get on.
Thanks

Azure Devops deploying Azure C# Function

I'm failing to use the Azure Devops Release management to deploy my Azure Functions.
Build
In the build pipeline, I've got two tasks:
dotnet publish
publich release artifact
This step succeeds
The artifact is published into /drop/a.zip
Release
In this step I have a Dev environment.
and a single task:
Azure Function App Deploy.
Credentials and which app to deploy to is specified.
There is a path specified to the release artifact like so:
I can even browse the path with the browse button in that image. and navigate to and pick the correct zip there.
But once this task runs. it all ends with a
##[error]Error: No package found with specified pattern: D:\a\r1\a\DotnetFunctions-CI\drop\a.zip
I am aware there are other questions here on SO bringing up the same question. however the answers I've seen there does not solve the issue here.
What am I missing?
I've had issue with the release pipeline not finding an artifact. What I've started doing is using the double wildcard search instead of the full path.
That is in my Deploy Azure App Service task inside the release pipeline.
My azure function works:
In Build :
Visual Studio Build Task :
Add following arguments in MSBuild section :
/p:DeployOnBuild=true /p:WebPublishMethod=Package /p:PackageAsSingleFile=true /p:SkipInvalidConfigurations=true /p:PackageLocation="$(build.artifactstagingdirectory)\$(BuildConfiguration)\\"
here is my build and release:
Build Configuration:
Release :

Azure DevOps Build Pipeline - Unable to deploy .NET Core app

I'm trying to create a CI/CT pipeline for my project. All the steps got completed successfully including Publish Build Artifacts but unfortunately I get an error during azure webapp deployment
Build Pipeline
Azure publish Step
Publish Artifact: Drop
Azure App Service Deploy: XXXX Server
I get following error in this step
Error: No package found with specified pattern: D:\a\1\a\Drop\xxx.xx.UI.API.zip
Any idea what I am doing wrong?
Remove the "Drop" from the "Package or folder" path in the Azure App Service Deploy task.
Create a release pipeline and use the Azure App Service Deploy task from there.