Hi @Matthew Farstad Greetings! Welcome to Microsoft Q&A forum. Thank you for posting this question here.
Is there no way to forcefully exit this job?
You can use the command az iot hub job cancel --hub-name {iothub_name} --job-id {job_id}
to cancel an existing job. To find more details about the command and the different parameters it can take, please refer to the documentation on az iot hub job
I'm not sure why their direct method is getting triggered
We would more information on how you have created the job to get a better understanding of this behavior. If you have used the CLI command az iot hub job create
to create the job, validate the options you have added to the --query-condition
parameter of the command. The parameter is used to target the devices on which the Direct method needs to be invoked. I suspect you might have skipped adding this parameter while you created the job. Consequently, the direct method matching the same name gets triggered on any device in your IoT Hub. This might explain the behavior you are observing.
To target a specific device using the Azure CLI command, you can use the command similar to the following
az iot hub job create --hub-name {HubName} --job-id {JobName} \
--job-type scheduleDeviceMethod \
--method-name {MethodName} --method-payload 'null' \
--query-condition "deviceId = '{DeviceName}'"
Hope this helps! Please let us know if you have any additional questions or need further assistance on this issue in the comments below. We would glad to help you further.
If the response helped, please do click Accept Answer and Yes for the answer provided. Doing so would help other community members with similar issue identify the solution. I highly appreciate your contribution to the community.