Ingest real-time data from Trimble via SignalR/WebSocket into Kusto aka. Azure Data Explorer, Synapse Data Explorer dedicated-pool, and Microsoft Fabric KQL Database in Real-Time Intelligence.
This repo contains sample DotNet Console App program in C# that uses WebSocket, SignalR, Kusto SDK. The program will connect to the Trimble Notification Service, provided a valid api-key, via WebSocket and streams messages (service-telemetry, GPS, ETA, OoC, Weather, etc.) into Kusto using DotNet SDK client libraries for real-time analytics.
The sample assets in this repo are not production solutions. They are samples for proof-of-concept or minimal-viable-product at best. The pipelines establish a data workflow for analytics end2end, including dashboard visualizations.
If you're wondering, what is Kusto, check out these videos:
- The mechanics of Real-Time Intelligence in Microsoft Fabric
- Real-Time Intelligence in Microsoft Fabric
- ADX at a glance
- How customers are using it?
Example of using WebSocket, Trimble Notification Service, Kusto SDK, and SignalR to stream messages into Kusto.
- .NET 8.0.201
- NuGet packages:
- Microsoft.AspNetCore.SignalR.Client
- Microsoft.Azure.Kusto.Data
- Microsoft.Azure.Kusto.Ingest
For your local IDE, recommend using VSCode with extensions C# Dev Kit, and Nuget Package Manager. Install the package dependencies using PowerShell terminal in VSCode by entering command: dotnet add package <package-name>
Additionally, StreamingIngestionSample console app is included in this repo to test ingestion & Kusto client libraries using fictitious data.
- https://github.com/Azure/azure-kusto-samples-dotnet
- https://learn.microsoft.com/azure/data-explorer/kusto/api/client-libraries
- https://aka.ms/fabric-learn
- https://aka.ms/fabric-docs-rta
- https://aka.ms/adx.youtube
- https://code.visualstudio.com/learn
- https://aka.ms/learn.kql
This sample Program.cs assumes:
- A valid Trimble API key with the TM add-on.
- Your Kusto cluster has streaming enabled. (Streaming is enabled by default for Fabric KQL Database & ADX Free-Personal Clusters)
- Your Kusto database has a table with the following schema:
.create table TrimbleNotificationRaw (message:dynamic)
Running Program.cs
- Add required DotNet packages.
- Enter the required parameters, then build the program.
- Deploy the program as an Azure Function when ready.
- Sample Azure Function - SignalRToKusto
-
Batching: SQL on-prem > csv file contains +1K "OFD/Active TripIds" (Query & File-transfer) > GET TrimbleAPI TripEvents (using Powershell) > store response in a file per Trip > Load local files to Fabric KQL Database using Get Data > run KQL queries & stored functions to flatten data for analytics > visualize query results in PBI or RTA Dashboard > Apply PBI filters for Dashboard use and parameters for RTA Dashboard.
in summary...
SQL > csv file > Trimble API > json files > Fabric KQL DB > KQL queries > PBI + RTA Dashboard.
-
Streaming: Trimble Notification Service > C# Client App (via Streaming) > Fabric KQL DB > KQL queries > Dashboards (TBD).
This Sample Code is provided for the purpose of illustration only and is not intended to be used in a production environment. THIS SAMPLE CODE AND ANY RELATED INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. We grant You a nonexclusive, royalty-free right to use and modify the Sample Code for your internal use only, provided that You agree: (i) to not use Our name, logo, or trademarks to market Your software product in which the Sample Code is embedded; (ii) to include a valid copyright notice on Your software product in which the Sample Code is embedded; and (iii) to indemnify, hold harmless, and defend Us and Our suppliers from and against any claims or lawsuits, including attorneys' fees, that arise or result from the use or distribution of the Sample Code.