Azure Digital Twins is a platform as a service (PaaS) offering that enables the creation of knowledge graphs based on digital models of entire environments. These environments could be buildings, factories, farms, energy networks, railways, stadiums, and more—even entire cities. These digital models can be used to gain insights that drive better products, optimized operations, reduced costs, and breakthrough customer experiences.
After nearly two years, Azure Digital Twins has been rewritten and it's off to a great start. In this session, we will see what it is for, see where it has changed, and see how to use it in our IoT strategy.
2. Marco Parenzan
Solution Sales Specialist in Insight for Digital Innovation
Azure MVP
Community Lead 1nn0va // Pordenone
Linkedin: https://www.linkedin.com/in/marcoparenzan/
Rome
Pordenone
5. What is a Digital Twin?
• Digital Twins are virtual replicas of physical devices that data scientists and
IT pros ca use to run simulations before actual devices are built and
deployed
• Tey are also changing how technologies such as IoT, AI and analytics are
optimized
• The this is constructed so that it can receive input from sensors gathering
data from real–world counterpart
• This allow the twin to simulate the physical object in real time
14. Add a footer 16
Azure Digital Twins Limits
• We are in preview (no pricing!)
• https://docs.microsoft.com/en-
us/azure/digital-twins/reference-
service-limits
16. Open Modeling Language
• Create custom domain models using «Digital Twins Definition Language» (DTDL)
• Model sdescribe twins in terms of
• Telemetry
• Properties
• Commands
• Relationships
• Components
• Models define semantic relationships to connect twins into a knowledge graph
• Models can specialize other thins using inheritance
• Digital Twins Definition language is aligned with
• IoT Plug and Play
• Time Series Insights data model
17. Live execution environment
• Create a live execution environment from the DTDL models in ADT
• Twin instances and relationships form a live graph representation of the
environment
• Use a rich event sustem to drive business logic and data processing.
• Use external compute such as Azure Functions
• Extract insights from the live execution environment with a powerful query
API
• Query using rich search conditions, including propertu values, relationships,
replationship properties, type information and more
18. Input from IoT & Business Systems
• User IoT Hub to Connect to IoT and IoT Edge devices to keep the live
execution environment up to date
• Use a new or an existing IoT Hub (no longer internal to Azure Digital Twins)
• Drive ADT from other data sources using REST APIs or create a Logic App
connector
19. Output to TSI, Storage & Analytics
• Use event routes to send data to downstream services via EventHub, Event
Grid or Service Bus
• Stora data in Azure Data Lake, analyze data with Azure Synapse and other
Microsoft Data Tools for analytics, integrate workflow with Logic Apps
• Connect Azure Digital Twins to Time Series Insights to track time seriesa
history on each node
• Aligned Time Series Model in Azure Time Series Insights mastered from
Azure Digital Twins
21. Anatomy of a Digital Twins Solution
• A Digital Twin instance
• IoT Hub and Connected Devices
• One or more client apps that connects with the DT Instance
• Create and manage a fraph o twin instances
• Extract insight from twin state
• A set of Azure functions or other propessing resources for custom processing
• Downstream services fro long-term storage, bulk data analutics, etc
22. Core Developer Responsibilities
• Model the environment
• Create twin definitions using DTDL and register the definitions with an ADT Instance
• Write code that generates and maintains a graph of Digital Twins using previously defined
models
• Process data and update state
• Create egress routes to external endpoints (event grid, event hib, service bus)
• Apply processing for business logic and data propagation
• Send data to downstream services (storage, analytics, ...)
• Write solution-specific frontend / UX code
• Build monitoring dashboards from ADT models and graph state
• Create visualizations of the graph
• Wire up UX event handlers to drive real time UX updates
• Build domain-specific query UX or rules engine UX to enable end-customer defined, domain-
specific queries on rules
23. Azure Digital Twins PaaS
• Platform for developers to model the real world
• Controlled using a rich set of REST APIs
• And Azure Portal and CLI
• C# SDK available for Public Preview
• SDK for additional languages coming
• Parser library for validation and “reflection” over DTDL
24. Azure CLI with Extensions for ADT
• Comfortable CLI commands to create and manage ADT instances
• Create, list and delete instances
• Manage RBAC
• Manage Endpoints
• Supports simple data plane command operations too
26. Open Modeling Language
• Create custom domain models using «Digital Twins Definition Language» (DTDL)
• Model sdescribe twins in terms of
• Telemetry
• Properties
• Commands
• Relationships
• Components
• Models define semantic relationships to connect twins into a knowledge graph
• Models can specialize other thins using inheritance
• Digital Twins Definition language is aligned with
• IoT Plug and Play
• Time Series Insights data model
27. DTDL Parser
• Parses and validates DTDL
• Provides a C# object model for DTDL models
• Handles DTDL models sets
• Can be used by client software
• To validate models before service update
• Oto find out which properties or methods are defined in a model (taking into account
inheritance)
• To drive UX generation code for model-driven UX
• C# code library distributed via NuGet
28. Modeling with Azure Digital Twins
Create a domain vocaboulary
• Describes the entities and concepts important for
your business
• Describe how entities relate and connect to each
other
• Use the Digital Twins Definition language (DTDL) to
author entities
• Open source specification
• Programming language independent
• Based on JSON-LD
• DTDL is also used to describe IoT devices
• Aligned with IoT Plug and Play and Time Series Insights
data model
• Enables Plug and Play connectivity for device
• Consistent programming model from ADT in the cloud to
devices
Build a model of your
environment
• Create instances of the specific
entities in your real world
• Connect the instances into a
topology graph that represents
your environment
• Define event processing and
routing for your environment
29. Twins Modeling
• The models are the nouns
• Properties
• Properties are data fields that
represent some state of a digital twin
• Use properties to represent a durable
state
• Read-only or writable
• Telemetry
• Telemetry fields represent
measurements
• Measurement are typically used for
the equivalent of sensor readings
(events)
• Commands (not supported in ADT yet)
• Commands represent methods can be
executed on the digital twin
• Example: reset command or switch on or off
• Relationships
• Relationships let you model how a given twin is
related to other twins
• Relationships can represent different semantic
meanings (“contains”, “cools”, “is-billed-by”, …)
verbs between nouns
• Components
• Component let you build your model from other
interface. Use a component to describe me
thing that is a part of your model. Use a
relationship to describe something that relates
to your model.
30. Simple interface example
• The top level of any twin
description is called an interface
• At the top level the twin description
has a dnumber of necessary fields:
• @id
• @type
• Contents
• @type
• Name
• Schema
• @context
31. Types
Properties and telemetry fields can use simple and complex types
• Schema attribute for properties, telemetry
and command arguments defines data type
• Simple types are primitives:
• Integer, Boolean, double, string, …
• Optional diplayUnit attribute to indicate a
unit for display
• Complex Types
• A complex type holds an array of fields
• Fields can be simple or complex type
themselves
• Complex types can be defined inline or as
repusabletypes
32. Relationships
Relaionships let you model how a given twin is related to other twins
• Relationships are uni-directional
• Bidirectional relationships can be
modeled as relationship pairs
• Relationships can be queried
• Relationship attributes
• Name: identifies the meaning of the
relationship
• Target the type of interface the
relationship targets
• Interfaces may define many different
relationship
33. Inheritance (or specialization)
A twin might need to be specialized for a given use case
• Interfaces can inherit from each other
• Interface inheritance works largely like in
C#
• names inherited from multiple interfaces
coalesce
39. Ingress
• Drive ADT using the REST API
• Any source that can call REST APIs can drive ADT
• Scenarios
• Event Handler function attached to IoT Hub
• Set properties on twins in response to telemetry messages
• Can be used with sources such as EventHubs or Event Grids
42. Routing and Route Filtering
Creating Listing and Deleting
Routes Route filtering
• ADT Messages use cloud event format
• Route filters today can filter against any
compination of CE header fields
• Type = ‘Microsoft.iot.telementry’
Subject = ‘thermostat67’
$body.Temperature > 25
43. Queries
• Get twins by properties
• Get twins by Model type
• Get twins by relationship properties
• Get twins using relationship traversal
• Any combination of about (AND OR NOT
operator) or properties, interfaces, relationship
properties and traversiing
• Continuation support with variable page size
in REST API
• Support for query comparison operators
(AND OR NOT, IN NOT IN, STARTWITH
ENDSWITH, = != < >
• Scala function support: IS_BOOL,
IS_DEFINED, IS_NULL, IS_NUMBER,
IS_OBJECT, IS_PRIMITIVE, IS_STRINGH,
STARTS_WITH, ENDS WITH
46. Conclusion
• Digital Twins are an important component of next-generation business
solutions and connected environments
• Azure Digital Twins
• Built around the ability to model your perspective of your real-world
• A live execution environment brought to live with data
• An event driven approach to data processing
• A powerfull query language
47. Add a footer 53
Can we do better?
• There is a lot of CosmosDb (SQL, not Gremlin) behind
• Pricing?
• Can I build a digital twin by my own? Sure you can and better, but…
• …I study solutions for customers
• this is huge to estimate “predictable pricing”…with prefabs