question

JogalekarMandar-9214 avatar image
0 Votes"
JogalekarMandar-9214 asked JogalekarMandar-9214 commented

Add custom parameter to adf_publish arm templates

I am new to data factory git repository management. Currently i have a pipeline which has a web activity.
The url of web activity is an external url to data factory. When this data factory is published, this url is not parametrized in adf_publish branch arm template.

While I have read, that we cannot directly make changes to adf_publish branch as it can only be published to from main branch.

What is the right way to solve this requirement. I want to add url as a parameter to the web activity so that it can be overriden during CI-CD Deployment

azure-data-factory
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

MartinJaffer-MSFT avatar image
0 Votes"
MartinJaffer-MSFT answered

Hello @JogalekarMandar-9214 and welcome to Microsoft Q&A.

I have thought of two solutions for you to peruse, one more granular than the other.





The more precise solution, is to create a global parameter, and reference the global parameter in the URL of the Web activity. Then you simply need override the global parameter during CI-CD.

The url in web activity could look like the below, depending on how you want to define or re-use.

 @pipeline().globalParameters.URLbase

 @concat(pipeline().globalParameters.URLbase, '/specific/endpoint')





The coarser solution, is to alter the ARM parameter configuration. This is less desirable because it will*affect all Web activities* in the factory. If you have only one web activity total, this might be fine, but could be unwieldy otherwise.

The excerpt from the parameterization template could look like below. The important part is the line starting with "url".

     "Microsoft.DataFactory/factories/pipelines": {
         "properties": {
             "activities": [{
                 "typeProperties": {
                     "url": "-::string"
                 }
             }]
         }
     },


5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

JogalekarMandar-9214 avatar image
1 Vote"
JogalekarMandar-9214 answered JogalekarMandar-9214 commented

i found second solution to be effective, however based on the nesting of activities, this syntax needed adjusting.


I had pipeline=>ForEach=>WebActivity.

   "Microsoft.DataFactory/factories/pipelines": {
     "properties": {
       "activities": [
         {
           "typeProperties": {
             "activities": [
               {
                 "typeProperties": {
                   "url": "-:-webUrl:string"
                 }
               }
             ]
    
           }
         }
       ]
     }
   }
· 2
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

@JogalekarMandar-9214 thank you for sharing the feedback. Especially how nesting of activities affects the syntax. I had not thought of this aspect. I will share this learning with my colleagues.

Please keep up the good work and have a great week/end!

0 Votes 0 ·

Hello ,
Thanks , i would suggest to update the microsoft documentation for this to be more clearer for this scenario.

https://docs.microsoft.com/en-us/azure/data-factory/continuous-integration-deployment#custom-parameter-syntax

0 Votes 0 ·