Skip to content

Commit 8b345c7

Browse files
committed
Edits
1 parent 137f0d2 commit 8b345c7

File tree

3 files changed

+12
-12
lines changed

3 files changed

+12
-12
lines changed

articles/iot-hub/how-to-device-twins.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ This article shows you how to:
5454

5555
* Retrieve a device twin and update reported properties
5656
* Update device twin tags
57-
* Create a device desired property update notificaiton callback
57+
* Create a device desired property update notificaton callback
5858
* Use a backend application to update tags and desired properties
5959
* Query devices from your back-end app using filters on the tags and properties previously created
6060

@@ -71,7 +71,7 @@ This article shows you how to:
7171

7272
* IoT Hub service connection string
7373

74-
In this article, you create a back-end service that adds desired properties to a device twin and then queries the identity registry to find all devices with reported properties that have been updated accordingly. Your service needs the **service connect** permission to modify desired properties of a device twin, and it needs the **registry read** permission to query the identity registry. There is no default shared access policy that contains only these two permissions, so you need to create one.
74+
In this article you create a back-end service that adds desired properties to a device twin and then queries the identity registry to find all devices with reported properties that have been updated accordingly. Your service needs the **service connect** permission to modify desired properties of a device twin, and it needs the **registry read** permission to query the identity registry. There is no default shared access policy that contains only these two permissions, so you need to create one.
7575

7676
To create a shared access policy that grants **service connect** and **registry read** permissions and get a connection string for this policy, follow these steps:
7777

includes/iot-hub-howto-device-twins-dotnet.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ ms.custom: mqtt, devx-track-csharp, devx-track-dotnet
1313

1414
## Create a device application
1515

16-
Device applications can read and write twin reported properties, and be notified of desired twin property changes that have been set by a backend application or IoT Hub.
16+
Device applications can read and write twin reported properties, and be notified of desired twin property changes that are set by a backend application or IoT Hub.
1717

1818
This section describes how to use device application code to:
1919

@@ -23,7 +23,7 @@ This section describes how to use device application code to:
2323

2424
### Add device NuGet Package
2525

26-
Device client applications requre the **Microsoft.Azure.Devices.Client** NuGet package.
26+
Device client applications require the **Microsoft.Azure.Devices.Client** NuGet package.
2727

2828
To install the **Microsoft.Azure.Devices.Client** NuGet package:
2929

@@ -94,13 +94,13 @@ catch (Exception ex)
9494

9595
You can create a desired property update callback handler that executes when the desired property is changed in the device by passing the callback handler method name to [SetDesiredPropertyUpdateCallbackAsync](/dotnet/api/microsoft.azure.devices.client.deviceclient.setdesiredpropertyupdatecallbackasync?#microsoft-azure-devices-client-deviceclient-setdesiredpropertyupdatecallbackasync(microsoft-azure-devices-client-desiredpropertyupdatecallback-system-object)).
9696

97-
For example, this call will set up the system to notify a method named`OnDesiredPropertyChangedAsync` whenever a desired property is changed.
97+
For example, this call sets up the system to notify a method named`OnDesiredPropertyChangedAsync` whenever a desired property is changed.
9898

9999
```csharp
100100
await _deviceClient.SetDesiredPropertyUpdateCallbackAsync(OnDesiredPropertyChangedAsync, null);
101101
```
102102

103-
The twin properties are passed to the callback method as a [TwinCollection](/dotnet/api/microsoft.azure.devices.shared.twincollection?view=azure-dotnet&branch=main) and can be examined as `KeyValuePair` structures.
103+
The twin properties are passed to the callback method as a [TwinCollection](/dotnet/api/microsoft.azure.devices.shared.twincollection) and can be examined as `KeyValuePair` structures.
104104

105105
This example receives the desired property updates as a `TwinCollection`, then loops through and prints the `KeyValuePair` collection updates. After looping through the `KeyValuePair` collection, the code calls `UpdateReportedPropertiesAsync` to update the `DateTimeLastDesiredPropertyChangeReceived` reported property to keep the last updated time up to date.
106106

@@ -143,7 +143,7 @@ This section describes how to create backend application code to:
143143

144144
### Add service NuGet Package
145145

146-
Backend service applications requre the **Microsoft.Azure.Devices** NuGet package.
146+
Backend service applications require the **Microsoft.Azure.Devices** NuGet package.
147147

148148
To install the **Microsoft.Azure.Devices** NuGet package:
149149

@@ -164,7 +164,7 @@ registryManager = RegistryManager.CreateFromConnectionString(connectionString);
164164

165165
### Read and update device twin fields
166166

167-
You can retrieve current device twin fields into a into a [Twin](/dotnet/api/microsoft.azure.devices.shared.twin) object by calling [GetTwinAsync](/dotnet/api/microsoft.azure.devices.registrymanager.gettwinasync?#microsoft-azure-devices-registrymanager-gettwinasync(system-string-system-string)).
167+
You can retrieve current device twin fields into a [Twin](/dotnet/api/microsoft.azure.devices.shared.twin) object by calling [GetTwinAsync](/dotnet/api/microsoft.azure.devices.registrymanager.gettwinasync?#microsoft-azure-devices-registrymanager-gettwinasync(system-string-system-string)).
168168

169169
The `Twin` class includes [properties](/dotnet/api/microsoft.azure.devices.shared.twin?&#properties) that correspond to each section of a device twin. Use the `Twin` class properties to view and update device twin fields. You can use the `Twin` object properties to update multiple twin fields before writing the updates to the device using `UpdateTwinAsync`.
170170

@@ -209,7 +209,7 @@ catch (Exception e)
209209

210210
##### Write using a JSON string
211211

212-
You can also create and apply a device twin information update patch that contains a block of field updates, including different field types such as tags mixed with desired properties. IoT Hub will parse and apply the patch if it is correctly formatted and the fields are updatable. For example, device twin reported properties cannot be updated by a backend application and the patch for these fields will not be applied.
212+
You can also create and apply a device twin information update patch that contains a block of field updates, including different field types such as tags mixed with desired properties. IoT Hub parses and applies the patch if it is correctly formatted and the fields are updatable. For example, device twin reported properties cannot be updated by a backend application and the patch for these fields are not be applied.
213213

214214
This example calls `GetTwinAsync` to retrieve the current device twin fields into a `Twin` object, creates a JSON-formatted `tag` patch with region and plant location information, then calls `UpdateTwinAsync` to apply the patch to update the device twin. An error message is displayed if `UpdateTwinAsync` failed.
215215

includes/iot-hub-howto-device-twins-python.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ This section describes how to use the Python SDK to create device and backend se
2121

2222
Device applications can read and write twin reported properties, and be notified of desired twin property changes that have been set by a backend application or IoT Hub.
2323

24-
The [IoTHubDeviceClient](/python/api/azure-iot-device/azure.iot.device.iothubdeviceclient) class contains methods that can be use to work with device twins.
24+
The [IoTHubDeviceClient](/python/api/azure-iot-device/azure.iot.device.iothubdeviceclient) class contains methods that can be used to work with device twins.
2525

2626
This section describes how to create device application code that:
2727

@@ -52,7 +52,7 @@ await device_client.connect()
5252

5353
### Retrieve a device twin and examine reported properties
5454

55-
You can retrieve and examine device twin information including tags and properties. The device twin information retrieved matches device twin schema that you can view for a device in the Auzre portal.
55+
You can retrieve and examine device twin information including tags and properties. The device twin information retrieved matches device twin schema that you can view for a device in the Azure portal.
5656

5757
Call [get_twin](/python/api/azure-iot-device/azure.iot.device.iothubdeviceclient?#azure-iot-device-iothubdeviceclient-get-twin) to get the device twin from the Azure IoT Hub service. The twin information is placed into a variable that can be printed or examined. This is a synchronous call, meaning that this function does not return until the twin is retrieved from the service.
5858

@@ -158,7 +158,7 @@ You can update device twin tags and desired properties from a backend applicatio
158158
* properties are stored in a [TwinProperties](/en-us/python/api/azure-iot-hub/azure.iot.hub.protocol.models.twinproperties) object
159159
1. Call [update_twin](/python/api/azure-iot-hub/azure.iot.hub.iothubregistrymanager?#azure-iot-hub-iothubregistrymanager-update-twin) to apply the patch to the device twin. You can also use [replace_twin](/python/api/azure-iot-hub/azure.iot.hub.iothubregistrymanager?#azure-iot-hub-iothubregistrymanager-replace-twin) to replace desired properties and tags for a device twin.
160160

161-
This example updates `region` and `plant` tag information. and sets a `power_level` desired property to `1`.
161+
This example updates `region` and `plant` tag information, and sets a `power_level` desired property to `1`.
162162

163163
```python
164164
new_tags = {

0 commit comments

Comments
 (0)