0
votes

We have different ADF environments such as TST,UAT & prod. In each environment the self hosted IR name is different. Is it possible to parameterize the integration runtime in ADF ARM Template, so that when the ARM templates deploys through CI/CD we can pass IR name in the DevOps Variable group during the deployment.

I have tried changing the Parametrization Template in ADF with below setting, but the IR name is still not available in the ARM template parameter JSON 'arm_template_parameters.json'.

enter image description here

4
Hi All, We have got a workaround for this issue. In the Azure DevOps pipeline we have created a PowerShell task to replace the self hosted IR name based on the variable group defined in the DevOps release pipeline. While deploying the ADF ARM template to different environment the shell script replace the IR name with environment specific IR names.Aneesh

4 Answers

2
votes

Hey @Aneesh and @Leon Yue, Good day!

Actually it is possible to parameterize the IR name in arm template and get it deployed based on Azure Devops :) For that you have to explicitly create a new parameter within ARM template and template parameter which you extract from ADF portal.

As seen below, till SQL Server1_properties was auto created after ARM template export. We manually created a new parameter IRName_properties_typeProperties_parametervalue"

enter image description here

Then within the template itself, replaced all the IR names values with the parameter :

enter image description here

Note : You also need to add the newly manually created parameter in the parameter template as well.

Then in Azure Devops Release pipeline, you can overwrite the parameters with the Devops variables

1
votes

As I searched, I found that it seams can't parameterize the integration runtime in ADF ARM Template.

Others have posted almost same question, Microsoft engineer provided some workarounds which may be helpful. He also said:

  • "You mean use custom parameters to parameterize IR name ? No there is no other way."

You can ref this question: ARM Template Custom Parameters for (self-hosted)Integration Runtime.

0
votes

Yes you can parameterize the IR runtime. but it's inner porpoerties.

You can give an alias to the IR you want to use, and use that same alias on DEV/UAT and PROD.

Then that alias will show up in your ARM template requesting a resourceId to the integration runtime to be used for it.

To be even more clear let's imagine you have 3 different ADF accounts:

  • ADF_DEV
  • ADF_UAT
  • ADF_PRD

Someone setup a self-hosted IR and it's resource id is something like: /subscriptions/xxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxx/resourcegroups/some-resource-group/providers/Microsoft.DataFactory/factories/SHARED_ADF/integrationruntimes/SOMESELFHOSTEDIR

So in ADF-DEV you will have a IR like this:

{
    "name": "SELFHOSTEDGW",
    "properties": {
        "type": "SelfHosted",
        "typeProperties": {
            "linkedInfo": {
                "resourceId": "/subscriptions/xxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxx/resourcegroups/some-resource-group/providers/Microsoft.DataFactory/factories/SHARED_ADF/integrationruntimes/SOMESELFHOSTEDIR",
                "authorizationType": "Rbac"
            }
        }
    }
}

Here you can see a custom alias for the IR as SELFHOSTEDGW. Just point your linked services to this alias, an on Devops just spcifify the different resource ids for this SELFHOSTEDGW alias.

0
votes

found that it seams can't parameterize the integration runtime in ADF ARM Template. We have got a workaround for this issue. In the Azure DevOps pipeline we have created a PowerShell task to replace the self hosted IR name based on the variable group defined in the DevOps release pipeline. While deploying the ADF ARM template to different environment the shell script replace the IR name with environment specific IR names.

#Powershell script

#getting the new IR name from Devops veriable group $integrationRuntime="$(integrationRuntimeName)"

#replacing IR name ((Get-Content -path ARMTemplateForFactory.json -Raw) -replace 'The IR NAME to be replaced',$integrationRuntime) | Set-Content -Path ARMTemplateForFactory.json

Get-Content -path ARMTemplateForFactory.json -Raw