Skip to content

Commit

Permalink
Update dataflow.bicep
Browse files Browse the repository at this point in the history
  • Loading branch information
david-emakenemi authored Oct 10, 2024
1 parent a9a34e2 commit 9c24117
Showing 1 changed file with 108 additions and 0 deletions.
108 changes: 108 additions & 0 deletions samples/quickstarts/dataflow.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ param defaultDataflowEndpointName string = 'default'
param defaultDataflowProfileName string = 'default'
param schemaRegistryName string = 'dfadfggg'
param aioInstanceName string = 'iotops-quickstart-cluster-ops-instance'
param eventGridHostName string = 'quicktest-de.westus2-1.ts.eventgrid.azure.net'

param opcuaSchemaName string = 'opcua-output-delta'
param opcuaSchemaVer string = '1'
Expand Down Expand Up @@ -429,3 +430,110 @@ resource dataflow_localstor 'Microsoft.IoTOperations/instances/dataflowProfiles/
]
}
}

// MQ Endpoint
resource MqttBrokerDataflowEndpoint 'Microsoft.IoTOperations/instances/dataflowEndpoints@2024-08-15-preview' = {
parent: aioInstance
name: 'aiomq'
extendedLocation: {
name: customLocation.id
type: 'CustomLocation'
}
properties: {
endpointType: 'Mqtt'
mqttSettings: {
authentication: {
method: 'ServiceAccountToken'
serviceAccountTokenSettings: {
audience: 'aio-internal'
}
}
host: 'aio-broker:18883'
tls: {
mode: 'Enabled'
trustedCaCertificateConfigMapRef: 'azure-iot-operations-aio-ca-trust-bundle '
}
}
}
}

// EventGrid Endpoint
resource remoteMqttBrokerDataflowEndpoint 'Microsoft.IoTOperations/instances/dataflowEndpoints@2024-08-15-preview' = {
parent: aioInstance
name: 'eventgrid'
extendedLocation: {
name: customLocation.id
type: 'CustomLocation'
}
properties: {
endpointType: 'Mqtt'
mqttSettings: {
authentication: {
method: 'SystemAssignedManagedIdentity'
systemAssignedManagedIdentitySettings: {}
}
host: eventGridHostName
tls: {
mode: 'Enabled'
}
}
}
}

// Dataflow for local to remote
resource dataflow_1 'Microsoft.IoTOperations/instances/dataflowProfiles/dataflows@2024-08-15-preview' = {
parent: defaultDataflowProfile
name: 'local-to-remote'
extendedLocation: {
name: customLocation.id
type: 'CustomLocation'
}
properties: {
mode: 'Enabled'
operations: [
{
operationType: 'Source'
sourceSettings: {
endpointRef: MqttBrokerDataflowEndpoint.name
dataSources: array('azure-iot-operations/data/thermostat')
}
}
{
operationType: 'Destination'
destinationSettings: {
endpointRef: remoteMqttBrokerDataflowEndpoint.name
dataDestination: 'telemetry/iot-mq'
}
}
]
}
}

// Dataflow for remote to local
resource dataflow_2 'Microsoft.IoTOperations/instances/dataflowProfiles/dataflows@2024-08-15-preview' = {
parent: defaultDataflowProfile
name: 'remote-to-local'
extendedLocation: {
name: customLocation.id
type: 'CustomLocation'
}
properties: {
mode: 'Enabled'
operations: [
{
operationType: 'Source'
sourceSettings: {
endpointRef: remoteMqttBrokerDataflowEndpoint.name
dataSources: array('telemetry/#')
}
}
{
operationType: 'Destination'
destinationSettings: {
endpointRef: MqttBrokerDataflowEndpoint.name
dataDestination: 'tutorial/cloud'
}
}
]
}
}

0 comments on commit 9c24117

Please sign in to comment.