Skip to content

Commit ba57967

Browse files
authored
Merge pull request #294820 from DENKEN02MSFT/ADTFreshnessTop40_Row28
ADT Freshness - Row 28
2 parents 559a7f7 + c36b5ce commit ba57967

File tree

3 files changed

+25
-25
lines changed

3 files changed

+25
-25
lines changed

articles/digital-twins/tutorial-command-line-app.md

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ titleSuffix: Azure Digital Twins
55
description: Tutorial to build an Azure Digital Twins scenario using a sample command-line application
66
author: baanders
77
ms.author: baanders # Microsoft employees only
8-
ms.date: 1/3/2024
8+
ms.date: 2/14/2025
99
ms.topic: tutorial
1010
ms.service: azure-digital-twins
1111

@@ -19,7 +19,7 @@ ms.service: azure-digital-twins
1919

2020
[!INCLUDE [digital-twins-tutorial-selector.md](../../includes/digital-twins-tutorial-selector.md)]
2121

22-
In this tutorial, you'll build a graph in Azure Digital Twins using models, twins, and relationships. The tool for this tutorial is the sample command-line client application for interacting with an Azure Digital Twins instance. The client app is similar to the one written in [Code a client app](tutorial-code.md).
22+
In this tutorial, you build a graph in Azure Digital Twins using models, twins, and relationships. The tool for this tutorial is the sample command-line client application for interacting with an Azure Digital Twins instance. The client app is similar to the one written in [Code a client app](tutorial-code.md).
2323

2424
You can use this sample to perform essential Azure Digital Twins actions such as uploading models, creating and modifying twins, and creating relationships. You can also look at the [code of the sample](https://github.com/Azure-Samples/digital-twins-samples/tree/main/) to learn about the Azure Digital Twins APIs, and practice implementing your own commands by modifying the sample project however you want.
2525

@@ -36,13 +36,13 @@ In this tutorial, you will...
3636

3737
### Run the sample project
3838

39-
Now that the app and authentication are set up, open a local **console window** that you'll use to run the project. Navigate in the console to the *digital-twins-samples-main\AdtSampleApp\SampleClientApp* folder, and run the project with this dotnet command:
39+
Now that the app and authentication are set up, open a local **console window** to run the project. Navigate in the console window to the *digital-twins-samples-main\AdtSampleApp\SampleClientApp* folder, and run the project with this dotnet command:
4040

4141
```cmd/sh
4242
dotnet run
4343
```
4444

45-
The project will start running, carry out authentication, and wait for a command.
45+
The project starts running, carries out authentication, and waits for a command.
4646

4747
Here's a screenshot of what the project console looks like:
4848

@@ -51,7 +51,7 @@ Here's a screenshot of what the project console looks like:
5151
> [!TIP]
5252
> For a list of all the possible commands you can use with this project, enter `help` in the project console and press return.
5353
54-
Once you've confirmed the app is running successfully, you can stop running the project. You'll run it again later in the tutorial.
54+
Once you confirm that the app is running successfully, you can stop running the project. You run it again later in the tutorial.
5555

5656
## Model a physical environment with DTDL
5757

@@ -62,7 +62,7 @@ The first step in creating an Azure Digital Twins solution is defining twin [mod
6262
Models are similar to classes in object-oriented programming languages; they're user-defined templates that you can instantiate to create [digital twins](concepts-twins-graph.md). Models for Azure Digital Twins are written in a JSON-like language called *Digital Twins Definition Language (DTDL)*, and they define a type of twin in terms of its properties, relationships, and components.
6363

6464
> [!NOTE]
65-
> DTDL also allows for the definition of commands on digital twins. However, commands are not currently supported in the Azure Digital Twins service.
65+
> DTDL also allows for the definition of commands on digital twins. However, commands aren't currently supported in the Azure Digital Twins service.
6666
6767
In the sample project folder that you downloaded earlier, navigate into the *digital-twins-samples-main\AdtSampleApp\SampleClientApp\Models* folder. This folder contains sample models.
6868

@@ -72,7 +72,7 @@ Open *Room.json* for editing, and make the following changes to the code:
7272

7373
### Upload models to Azure Digital Twins
7474

75-
After designing models, you need to upload them to your Azure Digital Twins instance. Doing so configures your Azure Digital Twins service instance with your own custom domain vocabulary. Once you've uploaded the models, you can create twin instances that use them.
75+
After designing models, you need to upload them to your Azure Digital Twins instance. Doing so configures your Azure Digital Twins service instance with your own custom domain vocabulary. Once you upload the models, you can create twin instances that use them.
7676

7777
1. Return to your console window that's open to the *digital-twins-samples-main\AdtSampleApp\SampleClientApp* folder, and run the console app again with `dotnet run`.
7878

@@ -84,7 +84,7 @@ After designing models, you need to upload them to your Azure Digital Twins inst
8484
8585
The output should indicate the models were created successfully.
8686
87-
1. Verify the models were created by running the command `GetModels true`. This command will print the full information for all the models that have been uploaded to your Azure Digital Twins instance. Look for the edited Room model in the results:
87+
1. Verify the models were created by running the command `GetModels true`. This command prints the full information for all the models that are uploaded to your Azure Digital Twins instance. Look for the edited Room model in the results:
8888
8989
:::image type="content" source="media/tutorial-command-line/app/output-get-models.png" alt-text="Screenshot of the result from GetModels, showing the updated Room model." lightbox="media/tutorial-command-line/app/output-get-models.png":::
9090
@@ -94,19 +94,19 @@ Keep the console app running for the next steps.
9494
9595
The sample application also handles errors from the service.
9696
97-
To test this, rerun the `CreateModels` command to try re-uploading the Room model that you've already uploaded:
97+
To test this error handling, rerun the `CreateModels` command to try reuploading the Room model that you already uploaded:
9898
9999
```cmd/sh
100100
CreateModels Room
101101
```
102102

103-
As models cannot be overwritten, this command will now return a service error indicating that some of the model IDs you are trying to create already exist.
103+
As models can't be overwritten, this command now returns a service error indicating that some of the model IDs that you're trying to create already exist.
104104

105105
For the details on how to delete existing models, see [Manage DTDL models](how-to-manage-model.md).
106106

107107
## Create digital twins
108108

109-
Now that some models have been uploaded to your Azure Digital Twins instance, you can create [digital twins](concepts-twins-graph.md) based on the model definitions. Digital twins represent the entities within your business environment—things like sensors on a farm, rooms in a building, or lights in a car.
109+
Now that some models are uploaded to your Azure Digital Twins instance, you can create [digital twins](concepts-twins-graph.md) based on the model definitions. Digital twins represent the entities within your business environment—things like sensors on a farm, rooms in a building, or lights in a car.
110110

111111
To create a digital twin, you use the `CreateDigitalTwin` command. You must reference the model that the twin is based on, and can optionally define initial values for any properties in the model. You don't have to pass any relationship information at this stage.
112112

@@ -129,7 +129,7 @@ To create a digital twin, you use the `CreateDigitalTwin` command. You must refe
129129
130130
### Modify a digital twin
131131
132-
You can also modify the properties of a twin you've created.
132+
You can also modify the properties of a twin you created.
133133
134134
> [!NOTE]
135135
> The underlying REST API uses [JSON Patch](http://jsonpatch.com/) format to define updates to a twin. The command-line app also uses this format, to give a truer experience with what the underlying APIs expect.
@@ -167,8 +167,8 @@ To add a relationship, use the `CreateRelationship` command. Specify the twin th
167167
```
168168
169169
>[!TIP]
170-
>The `contains` relationship in the [Floor model](https://github.com/azure-Samples/digital-twins-samples/blob/main/AdtSampleApp/SampleClientApp/Models/Floor.json) was also defined with two string properties, `ownershipUser` and `ownershipDepartment`, so you can also provide arguments with the initial values for these when you create the relationships.
171-
> Here's an alternate version of the command above to create relationship0 that also specifies initial values for these properties:
170+
>The `contains` relationship in the [Floor model](https://github.com/azure-Samples/digital-twins-samples/blob/main/AdtSampleApp/SampleClientApp/Models/Floor.json) was also defined with two string properties, `ownershipUser` and `ownershipDepartment`, so you can also provide arguments with the initial values for these properties when you create the relationships.
171+
> Here's an alternate version of the previous command you used to create `relationship0` that also specifies initial values for these properties:
172172
> ```cmd/sh
173173
> CreateRelationship floor0 contains room0 relationship0 ownershipUser string MyUser ownershipDepartment string myDepartment
174174
> ```
@@ -177,7 +177,7 @@ To add a relationship, use the `CreateRelationship` command. Specify the twin th
177177
178178
:::image type="content" source="media/tutorial-command-line/app/output-create-relationship.png" alt-text="Screenshot of an excerpt from the result of the CreateRelationship commands, which includes relationship0 and relationship1." lightbox="media/tutorial-command-line/app/output-create-relationship.png":::
179179
180-
1. You can verify the relationships with any of the following commands, which will print the relationships in your Azure Digital Twins instance.
180+
1. You can verify the relationships with any of the following commands, which print the relationships in your Azure Digital Twins instance.
181181
* To see all relationships coming off of each floor (viewing the relationships from one side):
182182
```cmd/sh
183183
GetRelationships floor0
@@ -194,7 +194,7 @@ To add a relationship, use the `CreateRelationship` command. Specify the twin th
194194
GetRelationship floor1 relationship1
195195
```
196196
197-
The twins and relationships you have set up in this tutorial form the following conceptual graph:
197+
The twins and relationships you set up in this tutorial form the following conceptual graph:
198198
199199
:::image type="content" source="media/tutorial-command-line/app/sample-graph.png" alt-text="A diagram showing a conceptual graph. floor0 is connected via relationship0 to room0, and floor1 is connected via relationship1 to room1." border="false" lightbox="media/tutorial-command-line/app/sample-graph.png":::
200200
@@ -217,7 +217,7 @@ Run the following commands in the running project console to answer some questio
217217
:::image type="content" source="media/tutorial-command-line/app/output-query-all.png" alt-text="Screenshot showing a partial result from the twin query, including room0 and floor1.":::
218218
219219
>[!TIP]
220-
>In the sample project, the command `Query` without any additional arguments is the equivalent of `Query SELECT * FROM DIGITALTWINS`. To query all the twins in your instance using the [Query APIs](/rest/api/digital-twins/dataplane/query) or the [CLI commands](/cli/azure/dt), use the longer (complete) query.
220+
>In the sample project, the command `Query` without any other arguments is the equivalent of `Query SELECT * FROM DIGITALTWINS`. To query all the twins in your instance using the [Query APIs](/rest/api/digital-twins/dataplane/query) or the [CLI commands](/cli/azure/dt), use the longer (complete) query.
221221
222222
1. What are all the rooms in my environment? (query by model)
223223
@@ -271,7 +271,7 @@ After completing this tutorial, you can choose which resources you want to remov
271271
272272
[!INCLUDE [digital-twins-cleanup-basic.md](../../includes/digital-twins-cleanup-basic.md)]
273273
274-
You may also want to delete the downloaded project folder from your local machine.
274+
You might also want to delete the downloaded project folder from your local machine.
275275
276276
## Next steps
277277
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
---
22
author: baanders
3-
description: include file for Azure Digital Twins - prerequisite to set up an instance
3+
description: Include file for Azure Digital Twins - prerequisite to set up an instance
44
ms.service: azure-digital-twins
55
ms.topic: include
6-
ms.date: 01/13/2023
6+
ms.date: 2/14/2025
77
ms.author: baanders
88
---
99

10-
To work with Azure Digital Twins in this article, you'll need an Azure Digital Twins instance and the required permissions for using it. If you already have an Azure Digital Twins instance set up, you can use that instance and skip to the next section. Otherwise, follow the instructions in [Set up an instance and authentication](../articles/digital-twins/how-to-set-up-instance-portal.md). The instructions contain information to help you verify that you've completed each step successfully.
10+
To work with Azure Digital Twins in this article, you need an Azure Digital Twins instance and the required permissions for using it. If you already have an Azure Digital Twins instance set up, you can use that instance and skip to the next section. Otherwise, follow the instructions in [Set up an instance and authentication](../articles/digital-twins/how-to-set-up-instance-portal.md). The instructions contain information to help you verify that you completed each step successfully.
1111

1212
After you set up your instance, make a note of the instance's host name. You can [find the host name in the Azure portal](../articles/digital-twins/how-to-set-up-instance-portal.md#verify-success-and-collect-important-values).

includes/digital-twins-tutorial-sample-prereqs.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
---
22
author: baanders
3-
description: prerequisites for Azure Digital Twins tutorials
3+
description: Include file that lists prerequisites for Azure Digital Twins tutorials
44
ms.service: azure-digital-twins
55
ms.topic: include
6-
ms.date: 9/12/2023
6+
ms.date: 2/14/2025
77
ms.author: baanders
88
---
99

@@ -19,11 +19,11 @@ Then, continue through the rest of this section to set up the remaining prerequi
1919

2020
The tutorial is driven by an [Azure Digital Twins end-to-end sample project written in C#](/samples/azure-samples/digital-twins-samples/digital-twins-samples). Get the sample project on your machine by navigating to the sample link, and selecting the **Browse code** button underneath the title.
2121

22-
This will take you to the GitHub repo for the samples, which you can download as a .zip by selecting the **Code** button followed by **Download ZIP**.
22+
This action takes you to the GitHub repo for the samples, which you can download as a .zip by selecting the **Code** button followed by **Download ZIP**.
2323

2424
:::image type="content" source="../articles/digital-twins/media/includes/download-repo-zip.png" alt-text="Screenshot of the digital-twins-samples repo on GitHub, highlighting the steps to download it as a zip." lightbox="../articles/digital-twins/media/includes/download-repo-zip.png":::
2525

26-
This will download a .zip folder to your machine as *digital-twins-samples-main.zip*. Unzip the folder and extract the files.
26+
This action downloads a .zip folder to your machine as *digital-twins-samples-main.zip*. Unzip the folder and extract the files.
2727

2828
### Prepare an Azure Digital Twins instance
2929

0 commit comments

Comments
 (0)