>> Learn how to get started with Azure Digital Twins,
in this episode of Azure Tips and Tricks.
With Azure Digital Twins,
you can model your real-world environment,
including buildings, IoT sensors,
and people to keep track of it,
monitor it, and design it.
Let's see how that works.
First, I need to create an Azure Digital Twins service in Azure.
Let's search for Digital Twins and there it is.
Create it. Okay. First, I'll select a resource group,
and I'll leave the location as it is.
Finally, let's fill in a name for the service.
Okay. That's it. Create it,
and I'll skip to when it is done.
This is the Azure Digital Twins service.
It exposes API endpoints that we
are going to use in a sample application.
To be able to use it,
I need access to the service.
I'll do that here,
and I will need to add a role assignment.
Okay. I need the role Azure Digital Twins Data Owner,
and I'll assign it to myself.
That's it. That should work.
In this video, we'll use a sample application to work
with Digital Twins called the Digital Twins Explorer.
You can download it from this URL,
which you can also find in the description of this video.
Also, you need to have Node.js installed on your local machine.
You also need the Azure CLI.
Once you've downloaded and unzipped the sample application,
navigate to the client folder and then to source.
You need to open that path in a command window like this.
Now run npm install to install the npm modules that the app needs.
When that is done, use npm run start to run the application.
This opens the app in a browser,
and it looks like this.
First, we need to connect to the Azure Digital Twins using
this button in the top and enter the URL,
which is the service's hostname,
with HTTPS in front of it.
Okay. We can use this app to create a design of
a real-world environment using Digital Twins.
This starts with modal definitions,
which describe things like sensors,
people, or structures of your environment.
I can import modules with this button.
There are some predefined ones in the sample app folder.
You can create these models with
a JSON-like language called the Digital Twin Definition Language.
Okay. So, these are definitions of a floor and a room.
Now I can create an environment with these using the twin graph.
You can create a graph definition
yourself and upload it using this button.
The sample app already contains a definition here.
Let's save it, sorted uploads to Azure.
Now, I can run a query against
the twin graph in Azure to retrieve the information.
This is a representation of
a real-world environment containing
two floors that each contain a room.
Each one is a Digital Twin,
which you can create with the modal definitions.
When I click on one,
I can see its properties like this.
This room has properties like temperature and humidity.
I can also create a different query to
answer questions about my environment like this.
This only results in one room as
the other one's temperature is below 75.
In this example, the temperature doesn't come from a real device.
But you can integrate real-world data into the graph,
so that your graph is up-to-date with the actual environment.
You can also edit properties of
a Digital Twin manually, like this.
Now, click the "Patch" button and
these are the changes that I'm going to upload to the graph.
Okay. Do it. Let's run that query again.
See, no results as I changed the temperature to below 75.
Cool. Azure Digital Twins enables you to design your environment,
monitor it, and plan for its future.
Go, and check it out.