本文介绍:

在本地运行ADT Explorer 并连接Azure Digital Twins 实例;

使用 VS CODE DTDL插件开发第一个 模型文件;

ADT Explorer的几个基本功能;

使用ADT Explorer 上传模型文件并生成 twin 孪生;

视频演示:

https://www.51azure.cloud/post/2021/4/12/azure-digital-twins-adt-explorer

重点图文步骤:

下载并在本地运行ADT Explorer


在ADT首页,点击 探索数字孪生体,了解更多连接打开ADT Explorer 工具下载页面

或者直接进入:下载 ADT Explorer:https://aka.ms/adt-explorer

在右侧release中下载最新版本

点击Azure_Digital_Twins_ADT_Explorer.zip 文件并下载

解压后,可以看到如下图内容,read me中包含安装方式:

1.本地安装

2.容器安装

3.在Azure 云中安装

本文仅介绍在本地安装运行。

按照如下步骤执行本地安装:

1. Set up an Azure Digital Twins service instance and give yourself appropriate permissions (e.g. *Azure Digital Twins Owner*). For instructions, please see the following how-to article:
*[Set up an Azure Digital Twins instance and authentication](https://docs.microsoft.com/azure/digital-twins/how-to-set-up-instance-portal)
1. When running locally, adt-explorer will use Azure default credentials. In order to authenticate, you can run, for example, **az login** in any command prompt. When you later run adt-explorer, it will pick up the credentials. Alternatively, you can sign into Visual Studio Code.
1. Select the **Download ZIP** button to download a .zip file of this sample code to your machine. Unzip the **Azure_Digital_Twins__ADT__explorer.zip** folder, and extract the files.
1. From a command prompt in the `client/src` folder, run `npm install`. This will retrieve all dependencies
1. From the same command prompt, run `npm run start`.
> By default, the app runs on port 3000. To customize the port, change the run command. For example, to use port 8080:
>* Linux/Mac (Bash): `PORT=8080 npm run start`
>* Windows (cmd): `set PORT=8080 && npm run start`
> Note: Your ADT app registration must have a reply URL using the same port you are using - e.g. localhost:7000 if that is the port you are using.
1. Your browser should open and the app should appear.
 
进入client/src,运行 npm install,注意,如果不知道npm是什么,可参照https://www.51azure.cloud/post/2020/4/15/azure-iot-hub-1-prepare 中安装node js 部分。

根据不同的操作系统,执行不同的命令:

>* Linux/Mac (Bash): `PORT=8080 npm run start`
>* Windows (cmd): `set PORT=8080 && npm run start`
 

可以看到 ADT Explorer已经在指定的端口运行了起来。

注意,ADT Explorer 本地运营依赖Azure CLI中的用户信息,需要在Azure CLI中执行 az login先登录自己的账户:

连接到ADT实例


将ADT的主机名拷贝

在ADT Explorer的右上角连接按钮中输入刚才复制的主机名,注意保留https

使用VS Code 开发第一个 模型文件


VS code中安装 DTDL插件

ctrl+shift+p 在上方输入 DTDL:Create interface

选择一个文件夹后,输入 模型文件名称:本例子输入的是 myfirstmodel

可以看到DTDL模型文件创建成功。本例子中不用修改该文件。

在ADT Explorer中上传模型并从模型生成twin


在ADT Explorer中点击上传模型按钮,选择刚才在vs code创建的 dtdl的json文件。

上传完成后,可以在ADT Explorer左侧看到 模型文件,点击模型文件的+,输入一个名称,可以为模型文件生成一个twin孪生

此过程类似于编程当中的,从 类 到 对象 的过程。

ADT Explorer 几个常见的功能:

1. 通过查询语句可以查询数字孪生实例中的twin孪生

2. 可在2处显示查询语句的查询结果

3.点击2处,可在右侧显示该twin的当前的数据

4. 点击4处可进行关系绑定,删除等操作


声明:

点击可查阅本站文章目录《文章分类目录》

本站所有内容仅代表个人观点,如与官文档冲突,请以官方文档为准。

可在本页面下方留言或通过下方联系方式联系我:

微信:wxyusz;邮箱:shuzhen.yu@foxmail.com

欢迎关注公众号“云计算实战”,接收最新文章推送。



本作品由Sean Yu 采用知识共享署名-非商业性使用-相同方式共享 4.0 国际许可协议进行许可。
欢迎转载、使用、重新发布,但务必保留文章链接:https://www.51azure.cloud,且不得用于商业目的。

Azure Digital Twins(2)- 在本地使用ADT Explorer 管理数字孪生的更多相关文章

  1. [New Portal]Windows Azure Virtual Machine (11) 在本地使用Hyper-V制作虚拟机模板,并上传至Azure (1)

    <Windows Azure Platform 系列文章目录> 本章介绍的内容是将本地Hyper-V的VHD,上传到Azure数据中心,作为自定义的虚拟机模板. 注意:因为在制作VHD的最 ...

  2. [New Portal]Windows Azure Virtual Machine (12) 在本地使用Hyper-V制作虚拟机模板,并上传至Azure (2)

    <Windows Azure Platform 系列文章目录> 本章介绍的内容是将本地Hyper-V的VHD,上传到Azure数据中心,作为自定义的虚拟机模板. 注意:因为在制作VHD的最 ...

  3. [New Portal]Windows Azure Virtual Machine (13) 在本地使用Hyper-V制作虚拟机模板,并上传至Azure (3)

    <Windows Azure Platform 系列文章目录> 本章介绍的内容是将本地Hyper-V的VHD,上传到Azure数据中心,作为自定义的虚拟机模板. 注意:因为在制作VHD的最 ...

  4. [New Portal]Windows Azure Virtual Machine (14) 在本地制作数据文件VHD并上传至Azure(1)

    <Windows Azure Platform 系列文章目录> 之前的内容里,我介绍了如何将本地的Server 2012中文版 VHD上传至Windows Azure,并创建基于该Serv ...

  5. [New Portal]Windows Azure Virtual Machine (21) 将本地Hyper-V的VM上传至Windows Azure Virtual Machine

    <Windows Azure Platform 系列文章目录> 本章介绍的内容是将本地Hyper-V的VHD,上传到Azure数据中心,并且保留OS中的内容. 注意:笔者没有执行Syspr ...

  6. Digital Twin 数字孪生

    GE的一个NB视频:http://v.youku.com/v_show/id_XMjk0NTMzODIyNA==.html http://www.gongkong.com/news/201701/35 ...

  7. [js开源组件开发]localStorage-cache本地存储的缓存管理

    localStorage-cache本地存储的缓存管理 距离上次的组件开发有近三个月的时间了,最近一直在做一些杂事,无法静下心来写写代码,也是在学习emberjs,在emberjs中有一个很重要的东西 ...

  8. 使用本地服务器组来管理局域网或公网上的SQLSERVER

    使用本地服务器组来管理局域网或公网上的SQLSERVER 测试的两台机器 Windows7 64位   SQLSERVER2005 SP5 Windows7 64位   SQLSERVER2012 S ...

  9. 新版Azure Automation Account 浅析(三) --- 用Runbook管理AAD Application Key

    新版Azure Automation Account 浅析(三) --- 用Runbook管理AAD应用的Key 前篇讲过有一个面向公众的Runbook库,社区和微软一直往其中加入新的Runbook, ...

随机推荐

  1. CAD颜色对照表

    cad颜色代码与RGB参数对应表 1 255 0 02 255 255 03 0 255 04 0 255 2555 0 0 2556 255 0 2557 0 0 08 128 128 1289 1 ...

  2. 24_MySQL插入insert语句

    本节涉及SQL语句: -- MYSQL 基础操作 1.插入insert语句 INSERT INTO t_dept(deptno,dname,loc) VALUES(70,"后勤部" ...

  3. docker镜像常用操作的基本命令

    1.拉取/下载镜像 docker pull 镜像名称       (可以从网易云镜像中心获取要下载的镜像) 2.查看已经下载的镜像 docker images 3.删除本地镜像 docker rmi ...

  4. vue之下拉菜单Dropdown的使用

    通过组件slot来设置下拉触发的元素以及需要通过具名slot为dropdown 来设置下拉菜单.默认情况下,下拉按钮只要hover即可,无需点击也会显示下拉菜单. <el-dropdown> ...

  5. 【翻译】Python PEP8编码规范(中文版)

    原文链接:http://legacy.python.org/dev/peps/pep-0008/ item detail PEP 8 Title Style Guide for Python Code ...

  6. ctf.show_web13(文件上传之.user.ini)

    这是一道文件上传题,先二话不说丢个图片码,显示为 先考虑文件太小,用burp抓包,添加了一堆无用的东西后显示仍然是error file zise,直到上传正常图片依旧如此,考虑文件太大.将一句话木马修 ...

  7. 优化程序性能(CSAPP)

    [前言]虽然现在没有接触过大型项目,但是工作了会注重性能.学习一下,应该能更好更快的理解别人写的经典优化的代码.结合CSAPP和自己的理解,总结一下. 一.程序优化综述 1.高效程序的特点 (1)适当 ...

  8. 后端程序员之路 33、Index搜索引擎实现分析2-对外接口和大体流程

    # index_manager的单例是index server对外的唯一接口,part_indexer是index搜索的核心部分,index_manager持有了一组part_indexer. typ ...

  9. jmeter数据库链接配置

    通常使用数据库有3个要求,性能好.数据一致性有保障.数据安全可靠:数据库优化的前提也是这三个要求.有句玩笑话叫少做少犯错,不做不犯错.DB优化的思路就是少做,减少请求次数,减少数据传输量,减少运算量. ...

  10. 微信小程序一周时间表

    <view class="dateView"> <image class="dateLeft" bindtap="prevWeek& ...