Creating an event route
Event routes are also created in the Azure Digital Twins instance. Follow these steps, as shown in the following screenshot:
- Open the existing Azure Digital Twins instance; that is,
DTBDigitalTwins
. - Select the Event routes option from the left menu.
- Press the + Create an event route button at the top.
- Enter
SensorTemperatureHigh
as the name for our endpoint. - Select the TemperatureWarnings endpoint.
- Enable the advanced editor and enter the following filter:
type = 'Microsoft.DigitalTwins.Twin.Update' AND $body.modelId = 'dtmi:com:smartbuilding:Sensor;1' AND $body.temperature > 25.0
Before we continue and save the event route, it would be good to explain what the filter does. The first part of the filter will only allow events that are generated through an update using the
Microsoft.DigitalTwins.Twin.Update
type. The second part of the filter defines the model type of the digital twin that we want to receive messages...