How to do string interpolation in Azure Data Factory

Background

Azure Data Factory allows us to add dynamic content in certain fields. Sometimes, we want to insert the value of variables, value of function or output of last activity into our string for dynamic content.

Solution

There are two approaches to achieve that.

  1. Azure Data Factory’s built-in function “concat”
  2. String Interpolation in Azure Data Factory

Azure Data Factory’s built-in function “concat”

Azure Data Factory has a built-in function “concat” which helps us concatenate string together, but this makes the dynamic content less readable.

String Interpolation in Azure Data Factory

Actually, we can do string interpolation in Azure Data Factory, which is similar to other programming languages, this approach can make our dynamic content much more to comprehend.

To achieve string interpolation, please put your variable inside “@{}”, i.e. @{your_variable_expression}. For example, it should be “@{variables(‘variable_name’)}” if your variable name is “variable_name”.

Bonus: Call functions with String Interpolation

On top of that, String Interpolation allows you to call other Azure Data Factory built-in functions inside the expression.

Original Post: https://joeho888.github.io/azure/azure%20data%20factory/2020/12/05/How-To-Do-String-Interpolation-Azure-Data-Factory/

LinkedIn: https://www.linkedin.com/in/ho-cho-tai-0260758a/

Infrastructure on Office 365, Power Platform and Azure Products