Can Azure DevOps pipelines be run in a specific order? - azure

Our repository contains a couple of CI pipelines for some services as a mono-repo. These pipelines deploy images to a docker image registry.
I want to run a separate pipeline to do the CD part, which pulls in the images from the registry and deploys them in a cluster. Is this dependency amongst different yaml pipelines possible in Azure DevOps?
In essense:
Let's assume we have Pipelines S1, S2, S3 for services.
I want to run Pipeline 'Deploy' after all three pipelines have finished.

If I'm understanding the question correctly, yes you can. But I don't think it's possible to trigger 1 pipeline when 3 others are completed.
You can trigger them 1 after another though, see the Microsoft Docs for reference: Trigger one pipeline after another

Related

Azure Devops-release pipeline

Can we create release pipeline in azure devops using yaml?
(I know we can add stages in pipelines ,but i want to know if we can create pipeline in pipelines -> release by yaml not classic pipeline.)
you can build and release in the same pipeline, we have a multi stage pipeline, the first stage builds the subsequent stages deploy to the different environments and run automated test
Alternatively you can separate it in to different yaml pipelines

Is it possible to forward an azure artifact from one pipeline to another?

I'm doing a project where I want a intermediate pipeline to consume an artifact from another pipeline to later forward it to another pipeline, which then starts running. I have not managed to find a solution online to this functionality and I'm starting to think that that functionality is not (as of today) supported in Azure DevOps. Can someone confirm whether this implementation is possible with pipelines? If not, how should one approach this scenario? I'm relatively new to Azure DevOps, so it's possible that I might have missed or misunderstood some information online.
I know that a pipeline can download an artifact which was published by another pipeline. And I know about pipeline triggers. Currently I have managed to consume artifacts in the intermediate pipeline, but now I have to find a way to send those artifacts to a specific pipeline, from the intermediate pipeline.
I appreciate all the help I can get.
but now I have to find a way to send those artifacts to a specific pipeline, from the intermediate pipeline.
We could publish build artifact from the intermediate pipeline by the Publish Build Artifacts or Publish Pipeline Artifacts task in the intermediate pipeline, then we use the Download Build Artifacts or Download Pipeline Artifacts task in the specific pipeline to download the artifact which we published from intermediate pipeline.
Yo could check this document Publish and download artifacts in Azure Pipelines for some more details.
Update:
Are you aware if this functionality is planned for Azure DevOps? If we
put it this way - is it possible for my intermediate pipeline to,
depending on some variables, trigger a specific pipeline (i.e. it can
trigger two different pipelines, but which one to trigger depends on
some variables)?
The answer is yes. There is extension Trigger Build Task, which can be used to trigger a new Build so that build-chaining is possible.
And we just need add the value of the variables as condition for this task, then we could trigger a specific pipeline depending on some variables.
Where this specific pipeline is in another project. Is it also
possible for this pipeline to access the variables which I created in
my intermediate pipeline?
I think I might understand what you want to achieve. you want to create some variables in the intermediate pipeline, then use this variables in the specific pipeline.
The answer is yes. But there is no directly way to access the variables which you created in intermediate pipeline. The solution we need to set the default value for the variables in the specific pipeline, then use REST API Definitions - Update to update those variables in the intermediate pipeline.
Please check my previous thread for detailed REST API scripts.
As far as I know, the solution would be adding Azure Artificats to store the output from Pipeline 1, then in Pipeline 2, download the artifact.
https://learn.microsoft.com/en-us/azure/devops/artifacts/overview?view=azure-devops

Azure DevOps CI/CD - Angular Project - nodeJS

AzureDevOps Pipeline
Hi, I'm about to do CI and CD for my angular project which is in Azure DevOps Repo.
i"m new to this and referring lots of documentation, i'm still not able to do.
Can some one help to with the step by step procedure ( videos if any) to the below listed pipeline tasks,
1) Pipeline,
2) Environments, 3) Releases
4) Library
5) Task Group
6) Deployment Groups.
Thanks in advance.
1)Pipeline
There're two formats of Azure Devops pipelines: Classic(UI) pipelines and Yaml pipelines.
They have different feature abilities. We can create Classic Build pipelines or multistage Yaml pipelines here.
2)Environments
The Environments represent a collection of resources targeted for deployment. It's used mostly for CD and it's not available in Classic pipelines, only available in Yaml pipeline.
3) Releases
We can create and manage Classic Release pipelines here. Mostly for CD.
4) Library
We can use this option to manage some variables group. Normally we can define pipeline variables, but those variables are not valid in another new pipeline. To reuse some common variables(Share variables across pipelines), we can consider using Variable Groups under Library.
5) Task Group
Similar to Variable Group under Library, it's used to reuse Tasks. If we have many pipelines in which use some similar tasks, we don't need to define the tasks one-by-one each time with Task Groups. See Create a Task Group.
6) Deployment Groups
Check its corresponding document here:
A deployment group is a logical set of deployment target machines that have agents installed on each one. Deployment groups represent the physical environments; for example, "Dev", "Test", "UAT", and "Production". In effect, a deployment group is just another grouping of agents, much like an agent pool.
Note: The Deployment Groups in your picture is only supported for Classic Release Pipeline, not yaml pipeline.
I'm about to do CI and CD for my angular project which is in Azure
DevOps Repo.
You don't need to know all the options above when you're new to Azure Devops. A quick-start about Angular project see here:
1.Build your angular project. It could be a simple script like this:
- script: |
npm install -g #angular/cli
npm install
ng build --prod
2.To deploy it, you can consider using Azure Web App Deploy Task.
Here's one detailed description about that from r3plica. You can easily turn it into classic UI format by using tasks with same names.

selection of task in release pipeline in azure devops

I have a build pipeline which I created and I have the artifacts in a drop folder.
Now I want to deploy these artifacts. The drop folder contains my data factory resources like pipelines, datasets.
I have 2 questions:
What task for the agent should I select in the release pipeline to deploy this folder?
How do I specify that in this environment it should go ? i.e. If I suppose have a QA environment, then how do I specify that thing?
I am actually confused over this selection of task for the agent.
What task for the agent should I select in the release pipeline to
deploy this folder?
It's based on where and how you want to deploy the artifacts.
If you just want to deploy them in a local machine where you can access, then you just need to add a Copy Files task to copy the artifacts to the target folder.
If you want to deploy to other remote sites or third party services, then you need to select other tasks based on your requirements, and some of them we need to create services connections to access them.
For example Deploy to Azure(e.g. Deploy a web app to Azure App Services)
How do I specify that in this environment it should go ? i.e. If I
suppose have a QA environment, then how do I specify that thing?
In release pipeline we can defined multiple environments/stages, in each environment we can add different tasks to do the actions based on our requirements. We need to add the artifacts sources to deploy them in the release pipeline. Please see Release pipelines for details. You can reference below links to do that:
Reference Exercise 2: Examine the CI/CD pipelines configured by
Azure DevOps Project
Azure DevOps - creating a release pipeline- Video Guide

Start ARM template deploy conditionally in Azure Devops

My source code is on GitHub.
I have an Azure Devops pipeline set up to build and deploy the application to an Azure subscription.
I also have the full azure environment defined in ARM templates.
I'd like to run the template deployment only when a specific folder changes in my GitHub repo.
Path triggers are only for Azure Devops repos.
Other possible solutions I investigated, but there is no clear documentation on how to achieve this exactly:
Custom condition on build or release task.
Pre-deployment conditions. Maybe artifact filters?
Pre-deployment Gates?
The ARM template deployment is idempotent, I know, but it takes a several long minutes to run even if there was no infrastructure change and I'd like to avoid that time wasted on every build.
Sounds like you have a single pipeline for both the infrastructure and application code. I have separate pipelines for each, one for infrastructure as code and other builds/pipelines for applications, NuGet package creation, etc. Perhaps split the pipeline and have the application deployment trigger after and separately from the infrastructure deployment pipeline. That way the application build and deployment can run in a more frequent cycle.

Resources