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.
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?
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