@cathrinew | cathrinew.net
Session Abstract
@cathrinew
cathrinew.net
You are an
Azure Data Factory
developer
This is getting
pretty tedious…
There has to be
a better way!
Dynamic
Solutions
Why would you use dynamic solutions?
How dynamic should the solution be?
How dynamic should the solution be?
What can make a solution dynamic?
Parameters and Variables:
Pass input values and set or update values during runtime
Expressions and Functions:
Modify the content of values during runtime
Loops and Lookups:
Control logic and executions based on external configuration values
Parameters
and Variables
What are Parameters?
How are Parameters passed?
trigger pipeline dataset
user
activity linked service
pipeline
Parameters
@pipeline().parameters.
@dataset().
@linkedService().
ParameterName
ParameterName
ParameterName
Parameters
@pipeline().parameters.
@dataset().
@linkedService().
ParameterName
ParameterName
ParameterName
Parameters
@pipeline().parameters.
@pipeline().DataFactory
@pipeline().TriggerTime
ParameterName
and System Variables
What are Variables?
How are variables controlled?
Set Variable Append Variable
Variables
@variables('VariableName')
@first(variables('VariableName'))
@last(variables('VariableName'))
Variables
@variables('VariableName')
@first(variables('VariableName'))
@last(variables('VariableName'))
Expressions
and Functions
What are Expressions?
the @ symbol
"@toUpper(pipeline().parameters.FileName)"
"COLORS.CSV"
What are Functions?
String:
Date:
Collection:
Logical:
Conversion:
Math:
concat, substring, startswith, endswith …
adddays, addhours, formatDateTime …
co s, f s , s , g h …
f, , o , qu s, ss, g …
createArray, y, jso , xm , …
add, sub, mul, v, m , m x, mo , …
Combining Strings
How to combine strings?
@concat()
@{…}
What is String Concatenation?
@concat(
' TRUNCATE TABLE dbo. ',
pipeline().parameters.TableName
)
What is String Interpolation?
TRUNCATE TABLE dbo.
@{pipeline().parameters.TableName}
DEMO
Let's add some
parameters!
Loops
ForEach Loop Input
@item()
Array Items
Array Items
Array Items
colors
@item()
Array Items
o ch
o ch
o y
o y
o y
o y
o y
o y
@item()
parts
@item()
colors
@item()
sets
Object Items
Object Items
Object Items
{ "Name": "colors", "Extension": "csv" }
@item()
Object Items
{ "Name": "colors", "Extension": "csv" }
@item().Name
Object Items
o ch
o ch
o y
o y
o y
o y
o y
o y
@item().Name
parts
@item().Name
colors
@item().Name
sets
DEMO
Let's add a loop!
Lookups
Lookup
Lookup Output
Lookup Output
Lookup Output: First Row Only
{
"Name" : "colors",
"Extension" : "csv"
}
@{activity('Lookup')
.output.firstRow}
Lookup Output: First Row Only
{
"Name" : "colors",
"Extension" : "csv"
}
@{activity('Lookup')
.output.firstRow
.Name}
Lookup Output: All Rows
@{activity('Lookup')
.output.value}
[
{
"Name" : "parts",
"Extension" : "csv"
},
{
"Name" : "sets",
"Extension" : "csv"
}
]
Lookup Output
First Row Only:
Use to pass single values to another activity
@{activity('Lookup').output.firstRow.ColumnName}
All Rows:
Use to pass entire collection to another activity
@{activity('Lookup').output.value}
DEMO
Let's add a lookup!
How do you make dynamic solutions?
1.
2. with parameters
3. solution in a loop
4. from configuration table
Good luck!
@cathrinew
cathrinew.net
hi@cathrinew.net
thank you!
Building Dynamic Data Pipelines in Azure Data Factory (Microsoft Ignite 2019)

Building Dynamic Data Pipelines in Azure Data Factory (Microsoft Ignite 2019)