ADF Deployment - Code changes in UAT, Prod

Santhi Dhanuskodi 165 Reputation points
2024-04-01T07:19:27.2966667+00:00

I have a dev instance of ADF(Azure Devops repository is configured) and I am going to deploy this to UAT and prod instances using CI/CD pipeline. I have a question in terms of code maintenance in repository. As all code will be in main branch, and that is common for all 3 environments, Can I change pipelines, dataflows or anything in UAT or PROD environment after deploying, (In cases). wat happens when I change the code in other instances, where this changed code will be stored. How it will affect other instances?

Azure Data Factory
Azure Data Factory
An Azure service for ingesting, preparing, and transforming data at scale.
9,804 questions
{count} votes

3 answers

Sort by: Most helpful
  1. Amira Bedhiafi 16,951 Reputation points
    2024-04-01T08:53:43.61+00:00

    You are touching a common challenge in software development and deployment practices, especially when it comes to manage code changes across different environments like DEV, UAT and PROD within ADF through CI/CD pipelines.

    I will break it in 3 parts :

    Your source control (in your case Azure DevOps repository) is key to managing your code across different environments. The best practice is to have a branching strategy that supports your development and release workflow. For ADF and similar services, you might consider the following:

    • Main Branch: all code in this branch should be production-ready
    • DEV Branch: Where developers merge their feature branches and perform initial tests
    • Release Branches: Temporary branches created from the main or development branch to prepare for a release to UAT or PROD

    Directly making changes in UAT or PROD is not recommended because it bypasses the CI/CD process, making the source control out of sync with your deployed environments. You may face some issues like ;

    • Changes made directly in UAT or PROD won't be tracked in source control, leading to discrepancies
    • Any deployments from the main branch after direct changes in UAT or PROD will overwrite those changes
    • Different configurations/code between environments can cause unexpected behaviors or bugs.

    What do EXPERTS recommend ?

    • For changes that are still under review or testing, use feature toggles to enable or disable functionality without affecting the main codebase.
    • Use parameter files or environment variables to manage different configurations for each environment without altering the code.
    • If an urgent fix is required in PROD, create a hotfix branch from the main, make the necessary changes, and then follow your CI/CD process to deploy. Once deployed, merge the hotfix branch back into the main branch.

    Finally, your CI/CD pipelines should be configured to handle deployments across all environments smoothly. This includes:

    • make sure that your tests are run at each stage of the pipeline to catch issues early.
    • Implement manual approval steps before deploying to UAT and especially to PROD to control what gets released.
    • Store your pipeline definitions in source control to track changes and maintain consistency across environments.

    Read more :

    https://learn.microsoft.com/en-us/azure/data-factory/continuous-integration-delivery

    https://learn.microsoft.com/fr-fr/azure/data-factory/continuous-integration-delivery-improvements


  2. ShaikMaheer-MSFT 38,291 Reputation points Microsoft Employee
    2024-04-01T09:52:44.0866667+00:00

    Hi Santhi Dhanuskodi,

    Thank you for posting query in Microsoft Q&A Platform.

    As per recommended approach for CI/CD only your DEV datafactory will be connected with Git repo and CI/CD process deploy the changes into UAT and PROD datafactories. Any changes we plan to implement should be in DEV datafactory only.

    Please check below my video to explain CI/CD approach for ADF.

    Continuous integration and deployment in Azure Data Factory

    Below the official documentation link for same.

    Continuous integration and delivery in Azure Data Factory

    Hope this helps. Please let me know if any further queries.


    Please consider hitting Accept Answer button. Accepted answers help community as well.


  3. Pinaki Ghatak 2,405 Reputation points Microsoft Employee
    2024-05-17T10:47:56.0366667+00:00

    Hello @Santhi Dhanuskodi

    It is not recommended to make changes to the code in UAT or PROD environments after deploying. This is because any changes made directly in these environments can cause inconsistencies between the environments and can lead to issues during deployment.

    If you need to make changes to the code, it is recommended to make the changes in the dev environment and then deploy the changes to UAT and PROD environments using the CI/CD pipeline with proper secure DevSecOps practices.

    This ensures that all environments are consistent and reduces the risk of issues during deployment.

    If you make changes to the code in UAT or PROD environments, these changes will not be reflected in the dev environment or any other environment.

    Check here:
    Continuous integration and delivery in Azure Data Factory

    and:

    Automate continuous integration using Azure Pipelines releases


    I hope that this response has addressed your query and helped you overcome your challenges. If so, please mark this response as Answered. This will not only acknowledge our efforts, but also assist other community members who may be looking for similar solutions.

    0 comments No comments