Skip to content

Commit adf1403

Browse files
fixing format
1 parent 1f4bacb commit adf1403

File tree

1 file changed

+86
-86
lines changed

1 file changed

+86
-86
lines changed

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

Lines changed: 86 additions & 86 deletions
Original file line numberDiff line numberDiff line change
@@ -62,95 +62,95 @@ To create a dataflow in [operations experience](https://iotoperations.azure.com/
6262

6363
1. Create a dataflow bicep file `dataflow.bicep`. Replace the placeholder values like `<SCHEMA_REGISTRY_NAME>` with your own.
6464

65-
```bicep
66-
var opcuaSchemaContent = '''
67-
{
68-
"$schema": "Delta/1.0",
69-
"type": "object",
70-
"properties": {
71-
"type": "struct",
72-
"fields": [
73-
{ "name": "AssetId", "type": "string", "nullable": true, "metadata": {} },
74-
{ "name": "Temperature", "type": "double", "nullable": true, "metadata": {} },
75-
{ "name": "Timestamp", "type": "string", "nullable": true, "metadata": {} }
76-
]
77-
}
78-
}
79-
'''
80-
81-
param defaultDataflowEndpointName string = 'default'
82-
param defaultDataflowProfileName string = 'default'
83-
param schemaRegistryName string = '<SCHEMA_REGISTRY_NAME>'
84-
85-
param opcuaSchemaName string = 'opcua-output-delta'
86-
param opcuaSchemaVer string = '1'
87-
88-
resource defaultDataflowEndpoint 'Microsoft.IoTOperations/instances/dataflowEndpoints@2024-08-15-preview' existing = {
89-
parent: aioInstance
90-
name: defaultDataflowEndpointName
91-
}
92-
93-
resource defaultDataflowProfile 'Microsoft.IoTOperations/instances/dataflowProfiles@2024-08-15-preview' existing = {
94-
parent: aioInstance
95-
name: defaultDataflowProfileName
96-
}
97-
98-
resource schemaRegistry 'Microsoft.DeviceRegistry/schemaRegistries@2024-09-01-preview' existing = {
99-
name: schemaRegistryName
100-
}
101-
102-
resource opcSchema 'Microsoft.DeviceRegistry/schemaRegistries/schemas@2024-09-01-preview' = {
103-
parent: schemaRegistry
104-
name: opcuaSchemaName
105-
properties: {
106-
displayName: 'OPC UA Delta Schema'
107-
description: 'This is a OPC UA delta Schema'
108-
format: 'Delta/1.0'
109-
schemaType: 'MessageSchema'
110-
}
111-
}
112-
113-
resource opcuaSchemaInstance 'Microsoft.DeviceRegistry/schemaRegistries/schemas/schemaVersions@2024-09-01-preview' = {
114-
parent: opcSchema
115-
name: opcuaSchemaVer
116-
properties: {
117-
description: 'Schema version'
118-
schemaContent: opcuaSchemaContent
119-
}
120-
}
121-
122-
resource dataflow 'Microsoft.IoTOperations/instances/dataflowProfiles/dataflows@2024-08-15-preview' = {
123-
parent: defaultDataflowProfile
124-
name: 'my-dataflow'
125-
extendedLocation: {
126-
name: customLocation.id
127-
type: 'CustomLocation'
128-
}
129-
properties: {
130-
mode: 'Enabled'
131-
operations: [
132-
{
133-
operationType: 'Source'
134-
sourceSettings: {
135-
// See source configuration section
65+
```bicep
66+
var opcuaSchemaContent = '''
67+
{
68+
"$schema": "Delta/1.0",
69+
"type": "object",
70+
"properties": {
71+
"type": "struct",
72+
"fields": [
73+
{ "name": "AssetId", "type": "string", "nullable": true, "metadata": {} },
74+
{ "name": "Temperature", "type": "double", "nullable": true, "metadata": {} },
75+
{ "name": "Timestamp", "type": "string", "nullable": true, "metadata": {} }
76+
]
77+
}
13678
}
137-
}
138-
{
139-
operationType: 'BuiltInTransformation'
140-
builtInTransformationSettings: {
141-
// See transformation configuration section
79+
'''
80+
81+
param defaultDataflowEndpointName string = 'default'
82+
param defaultDataflowProfileName string = 'default'
83+
param schemaRegistryName string = '<SCHEMA_REGISTRY_NAME>'
84+
85+
param opcuaSchemaName string = 'opcua-output-delta'
86+
param opcuaSchemaVer string = '1'
87+
88+
resource defaultDataflowEndpoint 'Microsoft.IoTOperations/instances/dataflowEndpoints@2024-08-15-preview' existing = {
89+
parent: aioInstance
90+
name: defaultDataflowEndpointName
14291
}
143-
}
144-
{
145-
operationType: 'Destination'
146-
destinationSettings: {
147-
// See destination configuration section
92+
93+
resource defaultDataflowProfile 'Microsoft.IoTOperations/instances/dataflowProfiles@2024-08-15-preview' existing = {
94+
parent: aioInstance
95+
name: defaultDataflowProfileName
14896
}
149-
}
150-
]
151-
}
152-
}
153-
```
97+
98+
resource schemaRegistry 'Microsoft.DeviceRegistry/schemaRegistries@2024-09-01-preview' existing = {
99+
name: schemaRegistryName
100+
}
101+
102+
resource opcSchema 'Microsoft.DeviceRegistry/schemaRegistries/schemas@2024-09-01-preview' = {
103+
parent: schemaRegistry
104+
name: opcuaSchemaName
105+
properties: {
106+
displayName: 'OPC UA Delta Schema'
107+
description: 'This is a OPC UA delta Schema'
108+
format: 'Delta/1.0'
109+
schemaType: 'MessageSchema'
110+
}
111+
}
112+
113+
resource opcuaSchemaInstance 'Microsoft.DeviceRegistry/schemaRegistries/schemas/schemaVersions@2024-09-01-preview' = {
114+
parent: opcSchema
115+
name: opcuaSchemaVer
116+
properties: {
117+
description: 'Schema version'
118+
schemaContent: opcuaSchemaContent
119+
}
120+
}
121+
122+
resource dataflow 'Microsoft.IoTOperations/instances/dataflowProfiles/dataflows@2024-08-15-preview' = {
123+
parent: defaultDataflowProfile
124+
name: 'my-dataflow'
125+
extendedLocation: {
126+
name: customLocation.id
127+
type: 'CustomLocation'
128+
}
129+
properties: {
130+
mode: 'Enabled'
131+
operations: [
132+
{
133+
operationType: 'Source'
134+
sourceSettings: {
135+
// See source configuration section
136+
}
137+
}
138+
{
139+
operationType: 'BuiltInTransformation'
140+
builtInTransformationSettings: {
141+
// See transformation configuration section
142+
}
143+
}
144+
{
145+
operationType: 'Destination'
146+
destinationSettings: {
147+
// See destination configuration section
148+
}
149+
}
150+
]
151+
}
152+
}
153+
```
154154

155155
1. Deploy via Azure CLI
156156

0 commit comments

Comments
 (0)