Skip to content

Commit e9298ba

Browse files
committed
Metatdata, links, and screenshots updated, minor Acrolinx fixes to improve score
1 parent 72f5f63 commit e9298ba

File tree

3 files changed

+24
-24
lines changed

3 files changed

+24
-24
lines changed

articles/digital-twins/how-to-create-routes.md

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ titleSuffix: Azure Digital Twins
44
description: Learn how to set up event routes and event filters to Azure Digital Twins endpoints
55
author: baanders
66
ms.author: baanders
7-
ms.date: 1/3/2024
7+
ms.date: 04/17/2025
88
ms.topic: how-to
99
ms.service: azure-digital-twins
1010
ms.custom: devx-track-azurecli
@@ -18,59 +18,59 @@ Routing [event notifications](concepts-event-notifications.md) from Azure Digita
1818

1919
## Prerequisites
2020

21-
* You'll need an Azure account, which [can be set up for free](https://azure.microsoft.com/free/?WT.mc_id=A261C142F)
22-
* You'll need an Azure Digital Twins instance in your Azure subscription. If you don't have an instance already, you can create one using the steps in [Set up an instance and authentication](how-to-set-up-instance-portal.md). Have the following values from setup handy to use later in this article:
21+
* You need an Azure account, which [can be set up for free](https://azure.microsoft.com/free/?WT.mc_id=A261C142F)
22+
* You need an Azure Digital Twins instance in your Azure subscription. If you don't have an instance already, you can create one using the steps in [Set up an instance and authentication](how-to-set-up-instance-portal.md). Have the following values from setup handy to use later in this article:
2323
- Instance name
2424
- Resource group
2525

2626
You can find these details in the [Azure portal](https://portal.azure.com) after setting up your instance.
2727

2828
:::image type="content" source="media/includes/instance-details.png" alt-text="Screenshot of the Overview page for an Azure Digital Twins instance in the Azure portal. The name and resource group are highlighted." lightbox="media/includes/instance-details.png":::
2929

30-
* Create an endpoint using the instructions in [Create endpoints](how-to-create-endpoints.md). In this article, you'll create a route to send data to that endpoint.
30+
* Create an endpoint using the instructions in [Create endpoints](how-to-create-endpoints.md). In this article, you create a route to send data to that endpoint.
3131

32-
Next, follow the instructions below if you intend to use the Azure CLI while following this guide.
32+
Next, perform the following instructions if you intend to use the Azure CLI while following this guide.
3333

3434
[!INCLUDE [azure-cli-prepare-your-environment-h3.md](~/reusable-content/azure-cli/azure-cli-prepare-your-environment-h3.md)]
3535

3636
[!INCLUDE [digital-twins-cli-issue](includes/digital-twins-cli-issue.md)]
3737

3838
## Create an event route
3939

40-
After [creating an endpoint](how-to-create-endpoints.md), you'll need to define an *event route* to actually send data to the endpoint. These routes let developers wire up event flow, throughout the system and to downstream services. A single route can allow multiple notifications and event types to be selected. Read more about event routes in [Endpoints and event routes](concepts-route-events.md).
40+
After [creating an endpoint](how-to-create-endpoints.md), you'll need to define an *event route* to actually send data to the endpoint. These routes let developers wire up event flow, throughout the system and to downstream services. A single route can allow multiple notifications and event types to be selected. For more information about event routes, see [Route Azure Digital Twins events](concepts-route-events.md).
4141

4242
>[!NOTE]
43-
> Make sure you've created at least one endpoint as described in the [Prerequisites](#prerequisites) before you move on to creating a route.
43+
> Make sure you created at least one endpoint as described in the [Prerequisites](#prerequisites) before you move on to creating a route.
4444
>
45-
>If you've only recently deployed your endpoints, validate that they're finished deploying before attempting to use them for a new event route. If route deployment fails because the endpoints aren't ready, wait a few minutes and try again.
45+
>If you only recently deployed your endpoints, validate that they're finished deploying before attempting to use them for a new event route. If route deployment fails because the endpoints aren't ready, wait a few minutes and try again.
4646
>
47-
> If you are scripting this flow, you may want to account for this by building in 2-3 minutes of wait time for the endpoint service to finish deploying before moving on to route setup.
47+
> If you're scripting this flow, you might want to account for deployment by building in 2-3 minutes of wait time for the endpoint service to finish deploying before moving on to route setup.
4848
4949
A route definition can contain these elements:
5050
* The route name you want to use
5151
* The name of the endpoint you want to use
5252
* A filter that defines which events are sent to the endpoint
5353
- To disable the route so that no events are sent, use a filter value of `false`
5454
- To enable a route that has no specific filtering, use a filter value of `true`
55-
- For details on any other type of filter, see the [Filter events](#filter-events) section below
55+
- For details on any other type of filter, see the following [Filter events](#filter-events) section
5656

5757
If there's no route name, no messages are routed outside of Azure Digital Twins.
5858
If there's a route name and the filter is `true`, all messages are routed to the endpoint.
59-
If there's a route name and a different filter is added, messages will be filtered based on the filter.
59+
If there's a route name and a different filter is added, messages are filtered based on the filter.
6060

61-
Event routes can be created with the [Azure portal](https://portal.azure.com), [EventRoutes data plane APIs](/rest/api/digital-twins/dataplane/event-routes), or [az dt route CLI commands](/cli/azure/dt/route). The rest of this section walks through the creation process.
61+
Event routes can be created with the [Azure portal](https://portal.azure.com), [Event Routes data plane APIs](/rest/api/digital-twins/dataplane/event-routes), or [az dt route CLI commands](/cli/azure/dt/route). The rest of this section walks through the creation process.
6262

6363
# [Portal](#tab/portal2)
6464

65-
To create an event route, go to the details page for your Azure Digital Twins instance in the [Azure portal](https://portal.azure.com) (you can find the instance by entering its name into the portal search bar).
65+
To create an event route, go to the details page for your Azure Digital Twins instance in the [Azure portal](https://portal.azure.com). You can find the instance by entering its name into the portal search bar.
6666

6767
From the instance menu, select **Event routes**. Then from the **Event routes** page that follows, select **+ Create an event route**.
6868

6969
On the **Create an event route** page that opens up, choose at minimum:
7070
* A name for your route in the **Name** field
7171
* The **Endpoint** you want to use to create the route
7272

73-
For the route to be enabled, you must also **Add an event route filter** of at least `true`. (Leaving the default value of `false` will create the route, but no events will be sent to it.) To do so, toggle the switch for the **Advanced editor** to enable it, and write `true` in the **Filter** box.
73+
For the route to be enabled, you must also **Add an event route filter** of at least `true`. (Leaving the default value of `false` creates the route, but no events are sent to it.) To do so, toggle the switch for the **Advanced editor** to enable it, and write `true` in the **Filter** box.
7474

7575
:::image type="content" source="media/how-to-create-routes/create-event-route-no-filter.png" alt-text="Screenshot of creating an event route for your instance in the Azure portal." lightbox="media/how-to-create-routes/create-event-route-no-filter.png":::
7676

@@ -97,25 +97,25 @@ This section shows how to create an event route using the [.NET (C#) SDK](/dotne
9797
9898
### Event route sample SDK code
9999

100-
The following sample method shows how to create, list, and delete an event route with the C# SDK:
100+
The following sample method shows how to create, list, and delete an event route with the .NET SDK:
101101

102102
:::code language="csharp" source="~/digital-twins-docs-samples/sdks/csharp/eventRoute_operations.cs" id="FullEventRouteSample":::
103103

104104
---
105105

106106
## Filter events
107107

108-
As described above, routes have a filter field. If the filter value on your route is `false`, no events will be sent to your endpoint.
108+
As described previously, routes have a filter field. If the filter value on your route is `false`, no events are sent to your endpoint.
109109

110-
After you've enabled a minimal filter of `true`, endpoints will receive different kinds of events from Azure Digital Twins:
110+
After you enabled a minimal filter of `true`, endpoints will receive different kinds of events from Azure Digital Twins:
111111
* [Telemetry fired by digital twins](concepts-event-notifications.md#digital-twin-telemetry-messages) using the Azure Digital Twins service API
112112
* Twin property change notifications, fired on property changes for any twin in the Azure Digital Twins instance
113113
* Life-cycle events, fired when twins or relationships are created or deleted
114114

115115
You can restrict the types of events being sent by defining a more-specific filter.
116116

117117
>[!NOTE]
118-
> Filters are case-sensitive and need to match the payload case. For telemetry filters, this means that the casing needs to match the casing in the telemetry sent by the device.
118+
> Filters are case-sensitive and need to match the payload case. For telemetry filters, the casing in the filter must match the casing in the telemetry sent by the device.
119119
120120
# [Portal](#tab/portal3)
121121

@@ -129,7 +129,7 @@ To use the basic filters, expand the **Event types** option and select the check
129129

130130
:::image type="content" source="media/how-to-create-routes/create-event-route-filter-basic-1.png" alt-text="Screenshot of creating an event route with a basic filter in the Azure portal, highlighting the checkboxes of the events." lightbox="media/how-to-create-routes/create-event-route-filter-basic-1-large.png":::
131131

132-
Doing so will autopopulate the filter text box with the text of the filter you've selected:
132+
Doing so autopopulates the filter text box with the text of the filter you selected:
133133

134134
:::image type="content" source="media/how-to-create-routes/create-event-route-filter-basic-2.png" alt-text="Screenshot of creating an event route with a basic filter in the Azure portal, highlighting the autopopulated filter text after selecting the events." lightbox="media/how-to-create-routes/create-event-route-filter-basic-2-large.png":::
135135

@@ -158,16 +158,16 @@ Here are the supported route filters.
158158
| True / False | Allows creating a route with no filtering, or disabling a route so no events are sent | `<true/false>` | `true` = route is enabled with no filtering <br> `false` = route is disabled |
159159
| Type | The [type of event](concepts-route-events.md#types-of-event-messages) flowing through your digital twin instance | `type = '<event-type>'` | Here are the possible event type values: <br>`Microsoft.DigitalTwins.Twin.Create` <br> `Microsoft.DigitalTwins.Twin.Delete` <br> `Microsoft.DigitalTwins.Twin.Update`<br>`Microsoft.DigitalTwins.Relationship.Create`<br>`Microsoft.DigitalTwins.Relationship.Update`<br> `Microsoft.DigitalTwins.Relationship.Delete` <br> `microsoft.iot.telemetry` |
160160
| Source | Name of Azure Digital Twins instance | `source = '<host-name>'`| Here are the possible host name values: <br><br> For notifications: `<your-Digital-Twins-instance>.api.<your-region>.digitaltwins.azure.net` <br><br> For telemetry: `<your-Digital-Twins-instance>.api.<your-region>.digitaltwins.azure.net/<twin-ID>`|
161-
| Subject | A description of the event in the context of the event source above | `subject = '<subject>'` | Here are the possible subject values: <br><br>For notifications: The subject is `<twin-ID>` <br> or a URI format for subjects, which are uniquely identified by multiple parts or IDs:<br>`<twin-ID>/relationships/<relationship-ID>`<br><br> For telemetry: The subject is the component path (if the telemetry is emitted from a twin component), such as `comp1.comp2`. If the telemetry isn't emitted from a component, then its subject field is empty. |
161+
| Subject | A description of the event in the context of the event source | `subject = '<subject>'` | Here are the possible subject values: <br><br>For notifications: The subject is `<twin-ID>` <br> or a URI format for subjects, which are uniquely identified by multiple parts or IDs:<br>`<twin-ID>/relationships/<relationship-ID>`<br><br> For telemetry: The subject is the component path (if the telemetry is emitted from a twin component), such as `comp1.comp2`. If the telemetry isn't emitted from a component, then its subject field is empty. |
162162
| Data schema | DTDL model ID | `dataschema = '<model-dtmi-ID>'` | For telemetry: The data schema is the model ID of the twin or the component that emits the telemetry. For example, `dtmi:example:com:floor4;2` <br><br>For notifications (create/delete): Data schema can be accessed in the notification body at `$body.$metadata.$model`. <br><br>For notifications (update): Data schema can be accessed in the notification body at `$body.modelId`|
163163
| Content type | Content type of data value | `datacontenttype = '<content-type>'` | The content type is `application/json` |
164164
| Spec version | The version of the event schema you're using | `specversion = '<version>'` | The version must be `1.0`. This value indicates the CloudEvents schema version 1.0 |
165165
| Notification body | Reference any property in the `data` field of a notification | `$body.<property>` | See [Event notifications](concepts-event-notifications.md) for examples of notifications. Any property in the `data` field can be referenced using `$body` |
166166

167167
>[!NOTE]
168-
> Azure Digital Twins currently doesn't support filtering events based on fields within an array. This includes filtering on properties within a `patch` section of a [digital twin change notification](concepts-event-notifications.md#digital-twin-change-notifications).
168+
> Azure Digital Twins currently doesn't support filtering events based on fields within an array. This limitation includes filtering on properties within a `patch` section of a [digital twin change notification](concepts-event-notifications.md#digital-twin-change-notifications).
169169
170-
The following data types are supported as values returned by references to the data above:
170+
The following data types are supported as values returned by references to the previous data:
171171

172172
| Data type | Example |
173173
|-|-|-|
@@ -192,13 +192,13 @@ The following functions are supported when defining route filters:
192192
|ENDS_WITH(x,y) | Returns true if the value `x` ends with the string `y`.|`ENDS_WITH($body.$metadata.$model, 'floor;1')`|
193193
|CONTAINS(x,y)| Returns true if the value `x` contains the string `y`.|`CONTAINS(subject, '<twin-ID>')`|
194194

195-
When you implement or update a filter, the change may take a few minutes to be reflected in the data pipeline.
195+
When you implement or update a filter, the change might take a few minutes to be reflected in the data pipeline.
196196

197197
## Monitor event routes
198198

199199
Routing metrics such as count, latency, and failure rate can be viewed in the [Azure portal](https://portal.azure.com/).
200200

201-
For information about viewing and managing metrics with Azure Monitor, see [Get started with metrics explorer](/azure/azure-monitor/essentials/metrics-getting-started). For a full list of routing metrics available for Azure Digital Twins, see [Azure Digital Twins routing metrics](how-to-monitor.md#routing-metrics).
201+
For information about viewing and managing metrics with Azure Monitor, see [Analyze metrics with Azure Monitor metrics explorer](/azure/azure-monitor/essentials/metrics-getting-started). For a full list of routing metrics available for Azure Digital Twins, see [Routing metrics](how-to-monitor.md#routing-metrics).
202202

203203
## Next steps
204204

-40.6 KB
Loading
-53.8 KB
Loading

0 commit comments

Comments
 (0)