Skip to content

Commit 150b481

Browse files
committed
Edits
1 parent cf9ff2d commit 150b481

File tree

3 files changed

+13
-9
lines changed

3 files changed

+13
-9
lines changed

articles/iot-hub/how-to-schedule-broadcast-jobs.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,15 @@ zone_pivot_groups: iot-hub-howto-c2d-1
1414

1515
# How to schedule and broadcast jobs
1616

17-
This article shows you how to create back-end app code to schedule device direct method and device twin desired property updates.
17+
This article shows you how to create back-end app code to schedule and broadcast jobs.
1818

19-
Use Azure IoT Hub to schedule and track jobs that update millions of devices. Use jobs to:
19+
Use Azure IoT Hub to schedule and track jobs that update up to millions of devices for the following:
2020

2121
* Update desired properties
2222
* Update tags
2323
* Invoke direct methods
2424

25-
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 tracks progress as each of the devices receives and executes the reboot direct method.
25+
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.
2626

2727
To learn more about each of these capabilities, see:
2828

includes/iot-hub-howto-schedule-broadcast-jobs-dotnet.md

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@ ms.custom: [amqp, mqtt, "Role: Cloud Development", "Role: IoT Device", devx-trac
1515

1616
## Overview
1717

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 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 desired property update on one or more devices.
1919

20-
### Add service NuGet Package
20+
### Add service NuGet package
2121

2222
Backend service applications require the **Microsoft.Azure.Devices** NuGet package.
2323

@@ -62,14 +62,15 @@ jobClient = JobClient.CreateFromConnectionString(connString);
6262

6363
### Create a direct method update job
6464

65-
Use [ScheduleDeviceMethodAsync](/dotnet/api/microsoft.azure.devices.jobclient.scheduledevicemethodasync) to create a new direct method to run a direct method on one or multiple devices.
65+
Use [ScheduleDeviceMethodAsync](/dotnet/api/microsoft.azure.devices.jobclient.scheduledevicemethodasync) to create a job to run a direct method on one or multiple devices.
6666

67-
This example schedules a job for a direct method method named "LockDoor".
67+
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.
6868

6969
```csharp
70-
string methodJobId = Guid.NewGuid().ToString();
71-
static string deviceId = "Device-1";
70+
string methodJobId = Guid.NewGuid().ToString(); // a unique job ID
71+
static string deviceId = "Device-1"; // In this example, there is only one device affected.
7272
73+
// The CloudToDeviceMethod record specifies the direct method name and device connection timeout.
7374
CloudToDeviceMethod directMethod =
7475
new CloudToDeviceMethod("LockDoor", TimeSpan.FromSeconds(5),
7576
TimeSpan.FromSeconds(5));

includes/iot-hub-howto-schedule-broadcast-jobs-node.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,9 @@ Call `scheduleTwinUpdate` to schedule the device twin desired property update jo
129129

130130
```javascript
131131
var twinJobId = uuid.v4();
132+
var queryCondition = "deviceId IN ['myDeviceId']";
133+
var startTime = new Date();
134+
var maxExecutionTimeInSeconds = 300;
132135

133136
console.log('scheduling Twin Update job with id: ' + twinJobId);
134137
jobClient.scheduleTwinUpdate(twinJobId,

0 commit comments

Comments
 (0)