Azure Digital Twins
Microsoft has built a comprehensive cloud platform in the last 10 years called Microsoft Azure. Every year, new services are released on the platform. One of them is Azure Digital Twins. Azure Digital Twins is part of the Internet of Things (IoT) platform and is called the next-generation IoT solution that models the real world.
The Azure Digital Twins service
The Azure Digital Twins service is a platform as a service (PaaS) that enables you to create digital replicas of an environment. PaaS is a cloud model where a provider delivers hardware and software tools enabling you to build your solutions without worrying about purchasing, installing, and maintaining hardware infrastructure.
It has a robust setup that provides a scalable and secure environment. It is part of IoT-connected solutions within Azure that allow it to connect to assets such as IoT devices as other Azure services and backend systems. The Azure Digital Twins service uses an event system to allow you to build your own business logic and data processing as routing. And it integrates with Azure services such as Azure Storage, Analytics, and Azure Machine Learning to extend the platform with predictiveness. The service can be created through the Azure portal.
Important terminology
Before we move forward, it is important to understand the different terminology used within Azure Digital Twins. Without it, it could become very confusing when explaining how Azure Digital Twins works:
- Azure Digital Twins instance – This represents the complete digital replica of reality.
- Model – A model is seen as the noun in a description within reality. It is like a class within programming and defines a part of that reality. Examples of a model are Room, Engineer, Asset, MotionSensor, and Device. Each model is described by properties, relationships, telemetry, components, and commands.
- Digital Twin – An instance of a model to represent a certain entity. An example is CoffeeRoom based on the Room model.
- Twin graph – A representation of Digital Twins and their underlying relationships.
Open modeling language
Models used in Azure Digital Twins are based on the Digital Twins Definition Language (DTDL). DTDL is used as a definition language for Azure Digital Twins and IoT Plug and Play. It is part of the IoT space and helps to describe the model's ability to support provisioning and configuration across the different IoT resources. DTDL uses a variant of JavaScript Object Notation (JSON) and is named JavaScript Object Notation for Linked Data (JSON-LD).
Important note
Azure Digital Twins uses DTDL version 2. While it uses DTDL as its modeling language, it does not currently implement DTDL commands.
Tools
There are several tools that are needed when you start working on Azure Digital Twins. First, you will require an Azure environment. The Azure environment allows us to create the Azure Digital Twins service and to monitor all the other services that we will be using throughout the book.
We will be using Azure Digital Twins Explorer to view an Azure Digital Twin that is created. The tool connects to an instance of the Azure Digital Twins service and allows you to query models.
In most cases, Azure resources such as Azure Functions, Azure Service Hub, and others are used to connect to the Azure Digital Twins service. Throughout the book, we will be using Microsoft Visual Studio to create code and deploy services to build Digital Twin examples.
In most scenarios, an Azure Digital Twins instance contains digital replicas of devices. These devices generate IoT data. While normally devices are connected and routed using Azure IoT Hub, you could also make use of IoT Central.
Azure IoT Hub is a managed cloud-hosted service that operates as a message hub for bi-directional communication between an IoT application and IoT devices.
IoT Central is a web-based service that allows you to connect a variety of different devices. But it is also possible to mimic these devices. You will get the available telemetry, which instead now generates demo IoT data. This allows you easily to test your Azure Digital Twins instance without the need for actual devices.
Costs
The Azure Digital Twins service does not have any upfront cost or termination fees. You only pay for your consumption. The service has billing at three levels:
You have learned about the Azure Digital Twins service and how this represents a Digital Twin within Microsoft Azure. We also talked about the modeling language and the costs of the service. In the next part, you will learn about the different Azure components that act as input and output services when building solutions with the Azure Digital Twins service.