Showing posts with label Azure DevOps. Show all posts
Showing posts with label Azure DevOps. Show all posts

How to fix the data factory adf_publish branch being out of sync with the master branch in azure devops

How to fix the data factory adf_publish branch being out of sync with the master branch in azure devops:

The data factory adf_publish branch can go out of sync if you change the path of the master branch file to another folder and delete the files from the old path. To solve this, please follow the steps below.

Steps:
  • Remove your current Git repository from Azure Data Factory v2
  • Reconfigure Git in your data factory with the same settings, but make sure Import existing Data Factory resources to repository is selected 
    • choose New branch
    • enter a new branch name
  • Create a pull request to merge the changes to the collaboration branch (master branch)
    • You can do this also by going to Azure Devops > Repos > Pull Requests
      • Create a new pull request 
      • Select your new branch and merge it into master

Azure Devops - Connect Data Factory to Azure DevOps Git repository

Today we will learn on how to set the code repository in Data Factory and link it with Azure Git
There are two ways to set up code repository in Data Factory
  1. Git
  2. Azure Git
Today, we will be using Azure Git as a code repository in Data Factory.

To Link Azure Git to Data Factory, you first have to setup Azure DevOps:

  1. Go to Azure Devops (https://aex.dev.azure.com/me?mkt=en-US)
  2. Create an Organization (if not created already)
  3. Add a project in that organization
  4. Assign team members (if any) and give them the appropriate permissions:
    1. For team members to create Git repos, they should have project admin rights
    2. If you want them to only contribute to existing project/Git Repo but not have them as an admin, assign them the contributor rights.
    3. Now, go inside the project and create a Test git repo

Once you have created an organization, project and a repo inside the project, you are ready to link the Azure code repository to Data Factory. 

Your Azure Devops structure should look like below:

Let's Link Code repository to Data Factory.

Go to your data factory and click "Author and Monitor" in the Overview Section. 
  • It will open a new link on the browser and take you inside the data factory instance.
  • In the data factory Overview section, click "Setup code repository"
  • Select the below options
    • Azure Git as Code repository as repository type
    • Your Azure Devops account (Organization)
    • Your Project (created within organization)
    • Your Git repo (created inside project)
    • Collaboration Branch: you can choose master.
      • Once you publish in data factory, it will create a new branch "Adf_Publish" where it will store it's ARM deployment templates.
  • Click Apply.
  • You are done.
Go inside the data factory by clicking "Author" and you will see your code repository linked.
Enjoy :)