Can I pass a file with different paths to Azure DevOps Path include trigger - azure-devops

I have set of azure devops pipelines and I want to use include path triggers for these yaml pipelines. I have multiple pipelines that will have these paths repeated. Is there a way I can pass in a text file with include or exclude paths so I can update in one place rather than each yaml pipeline? Or is there any better way to queue pipelines dynamically based on path changes?

Related

Azure DevOps - can I specify the location for the automatically-generated pipeline?

When I push a new repository with an azure-pipelines.yml file in the base folder, a pipeline is automatically created. When I view the Pipelines page, I see that it is it is created at location (root)\($projectname)\($projectname).
Can I configure the yml to create the pipeline in a different location, or do I have to do this manually?
You may add any path here (under review your pipeline YAML):

Azure DevOps single pipeline for multiple projects without multiple azure-pipelines.yml files

We have an Azure DevOps Pipeline defined as a template in a .yml file, and would like to use this to build 100+ projects.
There is zero parameterization to do, and the template essentially just runs against the project repo as-is.
Normally, we would just go into each of those project repos and create an azure-pipelines.yml file and reference the template pipeline, easy.
However, I would like to know if we can avoid creating these azure-pipelines.yml in each of the 100+ project repos. Is there some way to just run the template against 100+ repos, but as separate pipelines?
No.
YAML pipelines are based upon the YAML being stored in the application's repo, as code, alongside the application code. You can pull in templates from other repos, but you can't have one pipeline that is automatically valid for any repo.
Trying to use one template to build 100+ applications without the possibility of pinning the template to a specific version on an application by application basis is setting yourself up for a nightmare at some point in the future, when the template changes in such a way that it's no longer valid for a subset of your 100 applications.

How to select Solution file of a particular project to build in YAML pipeline?

I have two projects lets say A and B under one repository in azure Dev-ops. Each project has its own solution file.
The pipeline have tasks to build the solution and then upload the packages to the feed.
I want to select the solution file for project A if changes in pull requests are targeted for project A.
As of now i have created in a variable with default value and allowing user to override the variable name while triggering pipeline manually. PFB
But how to achieve same behavior to auto trigger the pipelines from
Pull Request. Is there any way to supply solution(.sln) name to
pipeline from pull request?
There is no way to implement that scenario within a single pipeline. Use two pipelines. Use different path filters to ensure the pipeline only triggers when appropriate paths change.

How to pass Variable value between two yaml pipeline in azure

I have two pipelines one is primary which triggers the other. How to pass a variable set on the first pipeline to second triggered one.
Example:
Variable-Name: Validate = True
I want to pass the validate variable to secondary triggered pipeline . I could not find any documentation that would help.
You could store the necessary value to a file, then include this file in current build's artifact (Publish pipeline artifact task).
Then in secondly pipeline, you could add Download Pipeline Artifacts task to download latest artifact of first build and read the content of necessary file.
If you are using pipeline resource (could enable trigger), please add Download task to download artifact of that pipeline resource.
Resources: pipelines

Cloning an Azure Devops yaml Pipeline

Azure Devops pipelines provide a clone functionality. This is super useful functionality for scaffolding pipelines. My yaml pipelines have a lot of variables, and it's difficult and error prone to reassign all of these variables from scratch.
The Azure Devops UI updated in the last week or so, and there doesn't seem to be an option to clone yaml pipelines anymore. Classic pipelines still have the clone option.
Can anyone figure out how to clone a yaml pipeline with the new UI?
Hmm I haven't used the clone feature, but have you investigated using variable groups or variable templates to make your life easier? You can link a variable group to Azure Key Vault to facilitate secrets.
I've never used a cloning option in YAML. But I wouldn't use so many Azure DevOps variables which were created in the UI. You have multiple options here:
Store the variables in your YAML file (not for secrets)
Store the variables in a YAML template (not for secrets)
Store the variables in a variable group (use Azure Key Vault or the Secure flag for secrets)
The variable group can be linked to multiple pipelines. But there is currently no scope available. So, if you have multiple environments, you have to name it like "myvariablegroup-dev", "myvariablegroup-prod". Hopefully, this feature to attach a variable group to an environment is coming in the near feature.
1,You can disable the multi-stage pipelines feature in preview features
On the top right corner of the page click the user profile and choose Preview features
Then disable the Multi-stage pipelines. Then you will see the clone option appear again.
2,The other workaround is to create a new pipeline and choose to use the Existing Azure PipelineS Yaml file while following the wizard. (which has the same effect with cloning yaml, they use the same azure-pipelines.yml file)
Then choose the same yaml file with the original pipeline.