cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Cooper01
Responsive Resident
Responsive Resident

Process for committing changes to a branch?

Let's say I have a feature branch, created from main. My updates for this feature include changes to a canvas app in a solution. Is there a way to automate the process of extracting the solution to source control when it's not in the main branch? I know how to create a pipeline to do this but when I create the pipeline I have to first select the branch. So is there any way to have a pipeline that points to a dynamic branch so I can run it on whatever branch I need to?

Ultimately I'd like to 

  1. Create the branch
  2. Complete dev work
  3. Add the work to the new branch
  4. Create a pull request and merge to main
1 ACCEPTED SOLUTION

Accepted Solutions

I think the challenge you are referring to is where you need your pipeline to point to an envrionment to unpack from depending on the branch you are running it on. 

When you run a pipeline you can select the branch - I then use a convention where I use a variable set that is named the same as the branch to provide the SPN etc. to use to connect to the corresponding environment that goes with that branch.
I then load that variable set using something like:

variables:
- group: branch-environment-${{ variables['Build.SourceBranchName'] }}

 

This way you can have a single pipeline that can be run on different branches and will pick up the environment details registered for that branch.

Hope this helps

View solution in original post

2 REPLIES 2

I think the challenge you are referring to is where you need your pipeline to point to an envrionment to unpack from depending on the branch you are running it on. 

When you run a pipeline you can select the branch - I then use a convention where I use a variable set that is named the same as the branch to provide the SPN etc. to use to connect to the corresponding environment that goes with that branch.
I then load that variable set using something like:

variables:
- group: branch-environment-${{ variables['Build.SourceBranchName'] }}

 

This way you can have a single pipeline that can be run on different branches and will pick up the environment details registered for that branch.

Hope this helps

View solution in original post

Cooper01
Responsive Resident
Responsive Resident

OMG. Have been running my pipelines from the editor and did not realize there was a Branch/tag ddl when you run it from the export list. I was mainly trying to avoid having to make developers spin up a new pipeline for each branch they create so I believe this solves the issue. Thanks @ScottDurow !!

Helpful resources

Announcements
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

secondImage

Demo Extravaganza is Back!

We are excited to announce that Demo Extravaganza for 2021 has started!

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

Power Apps June 2021

June Power Apps Community Call

Don't miss the call this month on June 16th - 8a PDT

Users online (67,133)