0

Is there a way to cancel a job that is running?

The answer on this question implies that it is not possible. However if you create Azure IoT Central application, when you schedule a job, they give you the option to automatically cancel a running job when certain % of errors occur.

enter image description here

Is this something internal and not available to public, or are there some SDKs, REST calls or any other ways to achieve this in custom developed applications?

OverflowStack
  • 825
  • 1
  • 14
  • 30
  • 1
    have a look at the REST APIs (version 1.2-preview) for Jobs in the IoT Central App: https://learn.microsoft.com/en-us/rest/api/iotcentral/1.2-previewdataplane/jobs/stop Note, that the Api token from your IoT Central App can be used for Authorization header and your appId for appsubdomain. – Roman Kiss Jun 15 '22 at 21:10

1 Answers1

1

Is this something internal and not available to public, or are there some SDKs, REST calls or any other ways to achieve this in custom developed applications?

Updated answer:

As commented by Roman Kiss, you can refer to Jobs - Stop

Note: The API token from your IoT Central App can be used for Authorization header and your appId for appsubdomain.


According to documentation, you can cancel scheduled job via REST API but as of now no way to cancel running job.

POST https://fully-qualified-iothubname.azure-devices.net/jobs/v2/{id}/cancel?api-version=2020-05-31-preview

You can refer to job_client.ts, job_client_requirements.md and Cancel Jobs in running status

Ecstasy
  • 1,866
  • 1
  • 9
  • 17