how to use parameter configuration file to add variables to a armTemplate

stejpal 0 Reputation points
2023-06-08T18:36:35.91+00:00

This question is about ADF deployments, using the dev environment codebase and deploy it to other envs. I would like to use the arm-template-parameters-definition file and instead of just parameterizing property-values as separate parameters in the arm-template. I would like to use the parameter-definition file to generate a set of variables and use those throughout the armTemplate. My Current requirement is to use variable for the retry-value for a web activity. I could not find a whole lot of details on what is and isn't possible with the parameters-file

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

1 answer

Sort by: Most helpful
  1. QuantumCache 20,371 Reputation points Moderator
    2023-06-10T16:22:53.31+00:00

    Hello @stejpal Thanks for reaching out on this forum.

    I was trying to understand the requirement! Correct me if needed!

    I would like to use the parameter-definition file to generate a set of variables....

    Did you consider a variable in the parameter file and use it in the ARM template?

    Something like below? how does your current ARM templates look like, please add some example on current and expected requirement!!

    {
        "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#",
        "contentVersion": "1.0.0.0",
        "parameters": {
            "retryValue": {
                "type": "int",
                "defaultValue": 3,
                "metadata": {
                    "description": "The number of times to retry the web activity."
                }
            }
        }
    }
    In the ARM template, you can reference the variable using the parameters function. Here is an example of how to use the variable in the ARM template1:
    
    {
        "name": "WebActivity",
        "type": "Microsoft.DataFactory/factories/pipelines/activities",
        "dependsOn": [
            "[concat('Microsoft.DataFactory/factories/', parameters('factoryName'))]"
        ],
        "properties": {
            "type": "WebActivity",
            "typeProperties": {
                "url": "https://www.example.com",
                "method": "GET",
                "retry": {
                    "count": "@parameters('retryValue')"
                }
            }
        }
    }
    

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.