ADF environment deployment without overwriting linked service configurations

Kofman, Gershom 20 Reputation points
2023-09-21T15:26:27.32+00:00

I use github actions Azure/data-factory-deploy-action to deploy ADF to production. However, the linked services configurations get overwritten. For example, production uses a different key vault, but in the ARM template the baseurl gets overwritten to match development.

I tried using linked services parameters, but their value gets overwritten as well. And global parameters can't be used in linked services.

I also tried changing parameter configuration with the line: "baseUrl": "-"

But this just causes baseUrl to take a null value.

Is there a way to use an ARM template that will not overwrite an existing value?

Azure Data Factory
Azure Data Factory
An Azure service for ingesting, preparing, and transforming data at scale.
10,594 questions
0 comments No comments
{count} votes

Accepted answer
  1. Amira Bedhiafi 23,486 Reputation points
    2023-09-21T19:05:56.68+00:00

    You will have to make your linked services configurable via ARM Template parameters. When you generate the ARM template for your Data Factory,you will need to include a parameters file (arm_template_parameters.json).

        {
          "parameters": {
            "linkedServiceName_baseUrl": {
              "value": "your-production-keyvault-url"
            },
            // other parameters...
          }
        }
    

    Then when deploying, supply a different parameters file depending on the environment, using either PowerShell or Azure CLI. For GitHub Actions, you can store these parameter files in your repository and choose the correct one depending on the branch or other conditions.

    There is another approach if you are opting for post-deployment scripts then you can run Azure PowerShell or Azure CLI scripts to update the linked services with the necessary properties for each environment.

    2 people found this answer helpful.

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.