Get azure-pipelines.yml file to specific branch - azure-devops

I want my Pipeline to work on a specific branch, different than master. After building Pipeline in DevOps the azure-pipelines.yml file goes to the master branch. Do I have to add this file manually to a different branch? Or it can be done somewhere during a configuration?

By default its being added to master branch, you'd need to cherry pick it into your desired branch, or just create it\edit it there in the first place. its just a file.

Related

Github Actions - Different workflow file per branch

I have a project in Github, which has 2 branches - dev & master.
Each branch has a different workflow yml file.
On pull request from dev to master it also includes the dev's yml file in the changes.
How can i make the .github/workflows ignored on pr's? Is it even possible?

How to get my branch as default in Azure Devops pipeline

When I go to run the pipeline it is bringing Master as default how to make it automatically grab my desired branch?
I want it to come loaded with the feat-regression-test branch:
https://learn.microsoft.com/en-US/azure/devops/repos/git/change-default-branch?view=azure-devops#set-a-new-default-branch
1 Under your project repo, select Branches.
2 On the Branches page, select More options next to the new default branch you want, and choose Set as default branch.

Azure DevOps Release Pipeline - Allowing branch selection at release time

I have a Release pipeline (Classic version) with artifact set to a Azure Git repo. The default branch is set to master branch. Every time someone creates a new release, latest version of master branch is copied to the Dev Ops agent and release tasks will run.
Is it possible to allow specification of branch at release creation time?
If I don't misunderstand, you would like to trigger release pipeline with specific branches.
You could try to add Branch filters.
A release will be triggered only if the Git push contains a commit on
the specified branch. For example, selecting "master" will trigger a
release for a Git push which contains one or more commits to the
master branch. To trigger a release for any commit to branches under
features/, enter "features/". To trigger a release for commits to all
branches, enter "". Note that all specified filters will be OR'ed.
For example, an artifact matching at least one filter condition would
be sufficient to trigger a release.
If you mean triggerring stages with specific branches, Artifact filters can do.
For more information, please refer to this document.

Cherry pick or selective merge from dev branch to prod

I have deployed Azure Data Factory pipelines and associated components to adf_publish branch in Azure Devops. Now I want to deploy those changes to the Prod branch, but the problem is that the Prod branch and adf_publish are not in sync. When I try to create a pull request I get 100 files and 100+ commits will be merged message which is not what I want. I want to merge only 1 Data Factory pipeline which was newly created and associated datasets (8) and Linked Service(1).
I tried the cherry pick method from the adf_publish branch but it still takes everything that is missing from Prod Branch. Is there an easy way to accomplish this either through the Azure Devops UI or through Visual Studio Code.
As per the screenshot below I see + next to multiple pipelines which indicates that they are not present in Prod branch, I just want to merge 1 pipeline and leave all the rest in adf_publish.
Any help would be highly appreciated. I have tried multiple things but nothing is working. Thanks
ADF_Publish branch will generate ARM templates for deployment automatically. Those templates you will be selecting as part of your release pipeline to perform deployment.
So, after merging ARM templates from ADF_Publish branch to another branch, if you are using same ARM template files from another branch to release deployment then it should work.
If the change(s) you seek aren't in separate commits, break the commit into individual commits using the approach outlined here. You use git rebase -i to obtain the original commit to modify, then git reset HEAD to selectively rollback changes, and finally git commit to commit that part as a new commit in the history.
Another useful technique is described in Red Hat Magazine, where they use git add —patch or maybe git add —interactive to add just sections of a hunk if you wish to separate various changes to specific files (search in that page for "split").
After splitting the modifications, you may now pick and choose which ones you wish.

How to trigger azure pipeline in one topic branch during push for another topic branch

My azure devops pipileine's yaml file is not in master branch of bitbucket. Its in another branch inside master branch (master/pipeline-branch). I am trying to trigger that build when there is a push to another topic branch which is also not the master branch. (master/topic/secondary).
In my yaml file I have written the trigger like this.
trigger:
- topic/secondary
But no build is triggered when I push a file to secondary branch.
you need to cherry pick\merge commits with this file to the secondary branch or just commit the yaml file to the secondary branch. when a commit is made a decision to start the build or not is being made by evaluating the yaml file inside the branch a commit was made to. if the file doesnt exist in that branch - there is nothing to trigger