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.

String Interpolation Example Illustration
String Interpolation Example Illustration

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.

Use built-in ‘concat’ function in Dynamic Content Modal
Use built-in ‘concat’ function in Dynamic Content Modal
Output — Azure Data Factory built-in ‘concat’ function
Output — Azure Data Factory built-in ‘concat’ function

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”.

Use String Interpolation in Dynamic Content Modal
Use String Interpolation in Dynamic Content Modal
Output — Azure Data Factory String Interpolation
Output — Azure Data Factory String Interpolation

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.

Use String Interpolation in other functions
Use String Interpolation in other functions
Output — String Interpolation inside other functions
Output — String Interpolation inside other functions

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

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Sensor fusion with Raspberry pi camera, Radar and ROS for Turtlebot3

Unity vs SceneKit: which tool you should use to build your ARKit app

Final Reflection

Which Platform Should I Choose for My Mobile App Development? iOS or Android?

What happens when you type gcc main.c ?

SERVERLESS: Essential in 7 minutes

Multiply Strings — Leetcode

IF you’re a BEGINNER.. here’s how to take what you already know to a next level.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Joe Ho

Joe Ho

Infrastructure on Office 365, Power Platform and Azure Products

More from Medium

Azure Data Factory: Keep your secrets in Azure Key Vault

Azure Synapse Analytics-SQL DW Pools

Beginners Guide to Read and Write data in Azure Databricks

Azure Automation Runbooks and Webhooks