ADF Collaboration branch vs Publish branch - azure

In my ADF I have set publish branch to the same branch as my source branch using publish_config.json
I can now save and publish to a single branch without setting a collaboration branch (collaboration branch also is seen with a star). I can simple select my branch from the drop down in ADF and work on it. As such what is the use of a collaboration branch?

The publish branch is just a place to store the generated ARM files for importing to another ADF. You only need the ARM files when importing to another ADF.
Your collaboration branch is the only branch where you get the "publish" button.
The collaboration branch is different also from the others for being able to call ADF pipelines from logic apps or anything else external to ADF (after using the publish button).

Related

Synapse pipeline import resource from git

I have a situation here where I import resources from my Azure DevOps Git repository DEV to TEST, I want DEV code to be independent of TEST and not commit my changes back to the repository.
After I import the repository to TEST I made changes to the SQL database connection string in the copy activity source and sink in TEST and had to commit the changes for the debug to run and the triggers I have setup for the pipelines don't run in TEST as per the schedule and fail in DEV because of the changes I did in TEST.
When move the pipelines and underlying objects to different environments, How do I make all the environments independent once I import repository? Is there a way to copy from the repository to the Synapse live mode to accomplish this?
OR How would I automate deployment of Synapse pipelines? Is it using ARM or Bicep Template?
You'll want to follow Microsoft's guide on CI/CD with Synapse. This is a great walkthrough video for the process.
The flow is:
Work in your development environment and commit to your collaboration branch.
A pipeline triggers off of your workspace_publish branch, releasing your code to your next environment (preferably with an approval gate)
Continue releasing the same code to higher environments, again with approval gates.
For Azure DevOps, you can use variable groups to parameterize your pipeline. Also make sure to read through the custom parameters section on that link to parameterize parts of the template that are not parameterized by default.

How to Trigger a build pipeline depends on create PR request source branch in Azure DevOps

I have a Develop branch and Master. My task is to trigger the build pipeline when I create a Pull Request from Develop to Master before merge, depends on Develop branch. The trigger should be from source branch. Can we add tags to trigger the build pipeline based on source branch. I am using classic pipelines and new to ADO. how can I achieve this. Please someone help me to achieve this in detail.
To get a pipeline to trigger when a PR is opened but before it is merged you would need to add a branch policy on master branch to have a build validation step. This will trigger the pipeline to run whenever a PR is opened to master
Build Validation
Unfortunately, PR trigger behaviour varies, depending on which SCM you're using: Azure Repos Git, GitHub, or Bitbucket Cloud. With BB Cloud, the PR build will be triggered when the PR is opened or updated, but not when it is merged. The filter input can be used to specify branches for PR trigger.
Details for each SCM system can be found by clicking on the links on the "Triggers in Azure Pipelines" documentation.
The way how to set that up does depend on your source-code version control software you are using. For GitHub you need to install the "Azure Pipeline" GitHub App.
Then configure a pipeline in AzureDev Ops and enable "Continous integration" in "Triggers" section.
P.S.: To avoid that the compile check of a PR will result in published artefacts you can either have to different pipelines or - that's what I try to achieve - one pipeline where the artefacts are just being generated when the PR is merged.

Azure Data Factory Environment Set up

I am setting up an environment for ADF. I have multiple projects and Segments which I need to support. I have noticed that I can only set up one publish branch in ADF.
Should we create ADF for each project?
What is the recommended approach for setting up an environment ?.
Multiple ADFs are required if there is complete different project with different data. If you want to work in same project and just need to manage different environment like development, testing and prod; all this can be managed in one ADF.
A developer creates a feature branch to make a change. They debug their pipeline runs with their most recent changes. For more information on how to debug a pipeline run, see Iterative development and debugging with Azure Data Factory.
After a developer is satisfied with their changes, they create a pull request from their feature branch to the main or collaboration branch to get their changes reviewed by peers.
After a pull request is approved and changes are merged in the main branch, the changes get published to the development factory.
When the team is ready to deploy the changes to a test or UAT (User Acceptance Testing) factory, the team goes to their Azure Pipelines release and deploys the desired version of the development factory to UAT. This deployment takes place as part of an Azure Pipelines task and uses Resource Manager template parameters to apply the appropriate configuration.
After the changes have been verified in the test factory, deploy to the production factory by using the next task of the pipelines release.
Note
Note: Only the development factory is associated with a git repository. The test and production factories shouldn't have a git repository associated with them and should only be updated via an Azure DevOps pipeline or via a Resource Management template.

DevOps deployment based on releases

I have a data factory instance which is linked to github, used for development.
I am having two different changes in the two different branches of data factory.
change01 and change02
I have merged these two changes into master branch and did a publish.
While doing a CI/CD even though these two changes are now available in the dev data factory instance, is it possible to deploy only change01 into other environments?
How can we control which release/change should go for deployment into other environments?
Can we do a build directly from a branch and push to prod?
To best accomplish this will have to to publish outside of the Data Factory editor. Each branch contains the necessary ARM components to publish the Data Factory ARM templates. The issue is when clicking the publish button Data Factory/ADO behind the scenes consolidates the ARM templates to just one .json file to make it easier to deploy while simultaneously deploying to the Data Factory destination.
The best course of action here might be to determine how to publish the ARM templates w/o clicking the publish button. This can be done by using ARM deployments or Powershell.
Furthermore I'd consider the potential options you have when considering how to managed and deploy Data Factory under CI/CD.
I would suggest to use separate branch and configure your builds to use proper one. Verify you builds in Azure Dev Ops.
It can be also helpful to cherry-pick changes which shouldn't be deployed.

Delete Multiple Azure Data Factory Pipeline

I want to delete 50+ ADF pipelines linked to Azure Devops GIT. We can do it manually via Azure Front-end, but it's a tedious task. I have tried deleting it via Powershell but powershell can only delete the pipelines which present under DataFactory(PFA the screenshot) mode whereas it is not impacting pipelines linked to Azure DevOps GIT.
Can anyone suggest any better approach to do this activity ?
If you just want them out of git, you can create a feature branch from the ADF editor. Then use Visual Studio or any git repo navigator to pull that branch to your local file system. Manually delete the files and then push back to git and do a pull request to merge back into your master.
If you really want to purge them completely, you can do the same manual deletion upon your ADF publish branch too.
I accomplished the task of deleting pipeline by :-
Creating a clone of the Dev branch in my local Visual studio.
By deleting all .json file (corresponding to the pipeline I wanted to delete) from newly cloned local branch.
Commit, Sync and Push the change to Dev GIT branch.
This is the easiest way I could find to delete 50+ pipelines in one shot.

Resources