Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Building systems can send many kinds of events through one stream. A thermostat event contains temperature fields, an occupancy event contains people counts, and a badge-reader event contains access information. Schema-aware Eventstreams let you inspect these heterogeneous events and classify them without creating a separate pipeline for each event type.
Important
Schema-aware Eventstreams are in Preview.
In this tutorial, you learn how to:
- Create a schema-aware Eventstream.
- Send four building operations event types through a custom endpoint.
- Inspect row details and nested JSON in Data preview.
- Download selected events as JSON.
- Classify events by using the
deviceTypefield. - Verify the classified event types and their detected shapes.
Prerequisites
- Access to a workspace with Contributor or higher permissions.
- The latest long-term support version of Node.js.
- A code editor such as Visual Studio Code.
Create a schema-aware Eventstream
In your Fabric workspace, select + New item.
Search for and select Eventstream.
Enter
building-operations-esas the eventstream name.Select Enable schema-aware eventstream (Preview).
Select Create.
Add a custom endpoint source
Open the eventstream in Edit mode.
Select Add source, and then select Custom endpoint.
Enter
building-operations-sourceas the source name, and then add the source.Select Publish.
In Live mode, select the custom endpoint source.
In the source details, copy these values:
- Connection string-primary key
- Event hub name
Important
The connection string contains a credential. Don't paste it into the Eventstream documentation, screenshots, or source control.
Send building operations events
Follow Generate building operations sample events to create and run the sample generator.
The generator sends 96 events by default: 24 events for each of these device types:
thermostatoccupancy_sensorair_quality_monitoraccess_badge_reader
Explore events in Data preview
- In the Eventstream, select the default stream.
- Select Data preview. You might need to select Refresh.
- Verify that the preview contains events with different values in the
deviceTypefield.
View the complete payload
Select an event row. You can also select multiple rows to view together.
Select View row details.
In Row details, select Payload (if needed).
Compare the fields in events from different device types.
Explore nested JSON
Return to Data preview.
On the
payloadcolumn, select Expand objects.Verify that the payload fields appear as separate grid columns and that the breadcrumb shows level 1.
Select an earlier breadcrumb level to return to the previous view.
Download representative events
Select one or more event rows.
Select Download.
Open the downloaded JSON and verify that it contains only the selected events.
Classify the events
Switch the Eventstream to Edit mode.
Select the default stream.
On the Data preview ribbon, select Classify unschematized events.
The Classify unschematized events dialog opens.
Select the
deviceTypecolumn.Review the four detected event types and their fields.
Select Save.
Select Publish.
Verify the classified event types
In Live mode, select the default stream.
In the Event type pane, expand Classified events.
Verify that these event types appear:
thermostatoccupancy_sensorair_quality_monitoraccess_badge_reader
Select each event type and compare the fields displayed in Data preview.
You now have one Eventstream that keeps the source events together while making each event type and its detected shape available for exploration and processing.
Clean up resources
If you don't plan to continue to the next schema-aware Eventstream tutorial,
delete the building-operations-es Eventstream and remove the generator
connection-string environment variable.