Adding custom parameter to ADF ARM template

Viewed 224

I have an ADF pipeline. The task is to productionize the pipeline. I am using azure devops CI/CD (classic). I am following this documentation https://docs.microsoft.com/en-us/azure/data-factory/continuous-integration-delivery-resource-manager-custom-parameters

I have to move the pipeline to test and prod. Thereforem, there are many parameters that are parametrized but few parameters like sql user_name, secret_name are not parametrized.

I want to edit the ARM template and add custom parameter so that I do not have to edit the template.json and paramete-template.json and push them again to repo. The edit option in adf allows to create custom params and therefore generate these in ARM templates when exported.

enter image description here

I have the parameter in the template.

enter image description here

The parameter secretName doesnt appear in ARM template in CD flow enter image description here

2 Answers

Which mode you are using to configure the parameters?

ARM parameter configuration is only enabled in "GIT mode". Currently it is disabled in "live mode" or "Data Factory" mode.

So, as per above official statement from Microsoft, you should be using Git repository.

Also, take note - Creating a custom Resource Manager parameter configuration creates a file named arm-template-parameters-definition.json in the root folder of your git branch. You must use that exact file name.

There are other multiple ways which you can try to pass secrets in ARM template. Refer this article from devkimchi.com.

After lot of tries and understanding the credential structure the ADF follows for different LinkedServices, we have found that to parametrize a custom nested argument, we have to specify the argument in a nested form. The parameter configuration needs to be edited like this:

enter image description here

For example, the secret name for SQL linked service (using password – connected to azurekeyvault) needs to be like this:

"password": {
    "secretName": "="
 }

But for the secret type (from azure keyvault) for storage linked service, it has to be like this:

"servicePrincipalCredential": {
    "secretName": "="
}

And then these args can be passed directly from azure keyvault if variable groups are connected to keyvault. This solves the problem we were facing.

Related