This repository contains a reference implementation for Azure Digital Twins. It focuses on splitting streaming ingress (devices and others) from graph-led ingress (e.g. weather data). Changes in the graph are subscribed to by functions with a single responsibility, rather than adding logic to your ingress layer. I created this reference to accompany my Copy The World With Azure Digital Twins presentation. You can find the slides here, feel free to check out the presentation abstract on Sessionize.
You can deploy this application to your Azure subscription. To do so, you'll need to add a couple of repository secrets.
The existing resource group name (create this yourself)
The contents of this secret can be generated with the following command:
az ad sp create-for-rbac --name CTWGitHubActions --role owner --scopes /subscriptions/{subscription-id}/resourceGroups/{resource-group-name} --sdk-auth
The ID of the application generated with the command above
Your Azure subscription ID
AZURE_TENANT_ID
The Deployment workflow will deploy all the infrastructure, as well as the code and configuration. Afterward, you can run the 🔥 Reset Demo Content workflow to upload all the twins and relationships, as well as the mapping configuration. Running it again will overwrite the entire graph.
Note: I like you, but please check the workflow to make sure you agree with what it's doing
Adding an Event Hub namespace and an S1 IoT Hub means there are costs involved even if you're not using the application. You can change the hub to be Free tier. You could also swap out the event hub for something else, but I do recommend Event Hubs for production workloads. All the other components are pay-per-use.