You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/iot-hub/how-to-schedule-broadcast-jobs.md
+2-3Lines changed: 2 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,7 +8,7 @@ manager: lizross
8
8
ms.service: azure-iot-hub
9
9
ms.devlang: csharp
10
10
ms.topic: how-to
11
-
ms.date: 1/7/2025
11
+
ms.date: 1/15/2025
12
12
zone_pivot_groups: iot-hub-howto-c2d-1
13
13
---
14
14
@@ -18,9 +18,8 @@ This article shows you how to create back-end app code to schedule and broadcast
18
18
19
19
Use Azure IoT Hub to schedule and track jobs that update up to millions of devices for the following operations:
20
20
21
-
* Update desired properties
22
-
* Update tags
23
21
* Invoke direct methods
22
+
* Updated device twin desired properties
24
23
25
24
A job wraps one of these actions and tracks the execution against a set of devices that is defined by a device twin query. For example, a back-end app can use a job to invoke a direct method on 10,000 devices that reboots the devices. You specify the set of devices with a device twin query and schedule the job to run at a future time. The job monitors progress as each of the devices receives and executes the reboot direct method.
This article describes how to use the [Azure IoT SDK for .NET](https://github.com/Azure/azure-iot-sdk-csharp/blob/main/readme.md) to create backend service application code to a schedule job to invoke a direct method or perform a device twin desired property update on one or more devices.
18
+
This article describes how to use the [Azure IoT SDK for .NET](https://github.com/Azure/azure-iot-sdk-csharp/blob/main/readme.md) to create backend service application code to a schedule job to invoke a direct method or perform a device twin update on one or more devices.
Use [ScheduleDeviceMethodAsync](/dotnet/api/microsoft.azure.devices.jobclient.scheduledevicemethodasync) to schedule a job to run a direct method on one or multiple devices.
66
66
67
-
The[CloudToDeviceMethod](/dotnet/api/microsoft.azure.devices.cloudtodevicemethod.-ctor?#microsoft-azure-devices-cloudtodevicemethod-ctor(system-string-system-timespan-system-timespan)) object to specify the direct method name and device connection timeout values.
67
+
Use the[CloudToDeviceMethod](/dotnet/api/microsoft.azure.devices.cloudtodevicemethod.-ctor?#microsoft-azure-devices-cloudtodevicemethod-ctor(system-string-system-timespan-system-timespan)) object to specify the direct method name and device connection timeout values.
68
68
69
69
```csharp
70
70
// The CloudToDeviceMethod record specifies the direct method name and device connection timeout
@@ -73,7 +73,7 @@ new CloudToDeviceMethod("LockDoor", TimeSpan.FromSeconds(5),
73
73
TimeSpan.FromSeconds(5));
74
74
```
75
75
76
-
This example schedules a job for a direct method method named "LockDoor" on one device named "Device-1". The device(s) included in the scheduled job are contained second parameter as a query condition.
76
+
This example schedules a job for a direct method named "LockDoor" on one device named "Device-1". The device(s) included in the scheduled job are contained second parameter as a query condition.
77
77
78
78
```csharp
79
79
stringmethodJobId=Guid.NewGuid().ToString(); // a unique job ID
@@ -85,9 +85,9 @@ JobResponse result = await jobClient.ScheduleDeviceMethodAsync(methodJobId,
85
85
(long)TimeSpan.FromMinutes(2).TotalSeconds);
86
86
```
87
87
88
-
### Schedule a device desired twin update job
88
+
### Schedule a device twin update job
89
89
90
-
Use [ScheduleTwinUpdateAsync](/dotnet/api/microsoft.azure.devices.jobclient.scheduledevicemethodasync) to schedule a new desired twin update job to run on one or multiple devices.
90
+
Use [ScheduleTwinUpdateAsync](/dotnet/api/microsoft.azure.devices.jobclient.scheduledevicemethodasync) to schedule a new device twin desired properties and tags update job to run on one or more devices.
91
91
92
92
First, create and populate a device `Twin` object for the update. For example:
* Requires [Java SE Development Kit 8](/azure/developer/java/fundamentals/). Make sure you select **Java 8** under **Long-term support** to navigate to downloads for JDK 8.
15
15
16
16
## Overview
17
17
18
-
This article describes how to use the [Azure IoT SDK for Java](https://github.com/Azure/azure-iot-sdk-java) to create backend service application code to schedule job to invoke a direct method or perform a device twin desired property update on one or more devices.
18
+
This article describes how to use the [Azure IoT SDK for Java](https://github.com/Azure/azure-iot-sdk-java) to create backend service application code to schedule job to invoke a direct method or perform a device twin update on one or more devices.
19
19
20
20
### Service import statements
21
21
@@ -102,9 +102,9 @@ try {
102
102
103
103
Use [scheduleUpdateTwin](/java/api/com.microsoft.azure.sdk.iot.service.jobs.jobclient?#com-microsoft-azure-sdk-iot-service-jobs-jobclient-scheduleupdatetwin(java-lang-string-java-lang-string-com-microsoft-azure-sdk-iot-service-devicetwin-devicetwindevice-java-util-date-long)) to schedule a job to run a device twin update on one or multiple devices.
104
104
105
-
This example method schedules a device twin update job for a specific job Id.
105
+
This example method schedules a device twin update job for a specific job ID.
106
106
107
-
First, prepare a `DeviceTwinDevice` record for the device twin update. For example:
107
+
First, prepare a [DeviceTwinDevice](/java/api/com.microsoft.azure.sdk.iot.service.devicetwin.devicetwindevice) record for the device twin update. For example:
108
108
109
109
```java
110
110
String deviceId ="Device-1";
@@ -144,7 +144,7 @@ try {
144
144
145
145
### Monitor a job
146
146
147
-
Use [getJob](/java/api/com.microsoft.azure.sdk.iot.service.jobs.jobclient?#com-microsoft-azure-sdk-iot-service-jobs-jobclient-getjob(java-lang-string)) to access a job status.
147
+
Use [getJob](/java/api/com.microsoft.azure.sdk.iot.service.jobs.jobclient?#com-microsoft-azure-sdk-iot-service-jobs-jobclient-getjob(java-lang-string)) to fetch job information based on a specific job ID. `getJob` returns a [JobResult](/java/api/com.microsoft.azure.sdk.iot.service.jobs.jobresult) object that contains methods and properties you can use to check job information including running status.
Copy file name to clipboardExpand all lines: includes/iot-hub-howto-schedule-broadcast-jobs-node.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,15 +7,15 @@ ms.author: kgremban
7
7
ms.service: azure-iot-hub
8
8
ms.devlang: nodejs
9
9
ms.topic: include
10
-
ms.date: 1/7/2025
10
+
ms.date: 1/15/2025
11
11
ms.custom: [amqp, mqtt, devx-track-js]
12
12
---
13
13
14
14
* Requires Node.js version 10.0.x or later
15
15
16
16
## Overview
17
17
18
-
This article describes how to use the [Azure IoT SDK for Node.js](https://github.com/Azure/azure-iot-sdk-node) to create backend service application code to schedule job to invoke a direct method or perform a device twin desired property update on one or more devices.
18
+
This article describes how to use the [Azure IoT SDK for Node.js](https://github.com/Azure/azure-iot-sdk-node) to create backend service application code to schedule job to invoke a direct method or perform a device twin update on one or more devices.
Use [create_scheduled_job](/python/api/azure-iot-hub/azure.iot.hub.iothubjobmanager?#azure-iot-hub-iothubjobmanager-create-scheduled-job) to create a new job to run a device twin update on one or multiple devices.
109
+
Use [create_scheduled_job](/python/api/azure-iot-hub/azure.iot.hub.iothubjobmanager?#azure-iot-hub-iothubjobmanager-create-scheduled-job) to create a new job to run a device twin desired properties update on one or multiple devices.
0 commit comments