Skip to content

Commit 6dc821e

Browse files
Added bicep syntax for transformation
1 parent 4e4e998 commit 6dc821e

File tree

1 file changed

+29
-5
lines changed

1 file changed

+29
-5
lines changed

articles/iot-operations/connect-to-cloud/howto-create-dataflow.md

Lines changed: 29 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -405,7 +405,16 @@ This example shows how you could use the `deviceId` field in the source data to
405405

406406
```bicep
407407
builtInTransformationSettings: {
408-
// TODO: Add bicep template to enrich data
408+
datasets: [
409+
{
410+
key: 'assetDataset'
411+
inputs: [
412+
'$source.deviceId', // Reference to the device ID from the source
413+
'$context(assetDataset).asset' // Reference to the asset from the dataset context
414+
]
415+
expression: '$1 == $2' // Expression to evaluate the inputs
416+
}
417+
]
409418
}
410419
```
411420

@@ -479,10 +488,14 @@ For example, you could use the `temperature` field in the source data to filter
479488
```bicep
480489
builtInTransformationSettings: {
481490
filter: [
482-
// TODO
491+
{
492+
inputs: [
493+
'temperature ? $last' // Reference to the last temperature value, if available
494+
]
495+
expression: '$1 > 20' // Expression to filter based on the temperature value
496+
}
483497
]
484498
}
485-
486499
```
487500

488501
# [Kubernetes](#tab/kubernetes)
@@ -525,10 +538,21 @@ For example, you could use the `temperature` field in the source data to convert
525538
```bicep
526539
builtInTransformationSettings: {
527540
map: [
528-
// TODO
541+
{
542+
inputs: [
543+
'temperature' // Reference to the temperature input
544+
]
545+
output: 'temperatureCelsius' // Output variable for the converted temperature
546+
expression: '($1 - 32) * 5/9' // Expression to convert Fahrenheit to Celsius
547+
}
548+
{
549+
inputs: [
550+
'$context(assetDataset).location' // Reference to the location from the dataset context
551+
]
552+
output: 'location' // Output variable for the location
553+
}
529554
]
530555
}
531-
532556
```
533557

534558
# [Kubernetes](#tab/kubernetes)

0 commit comments

Comments
 (0)