How to shutdown gracefully an Azure custom module using .net?

Kenia Sanchez 20 Reputation points
2023-09-26T22:55:49.15+00:00

I want to shutdown a custom module after it has ran. Is there a way to programmatically shutdown (runtime status = stopped) a custom module using .Net?

Azure IoT Edge
Azure IoT Edge
An Azure service that is used to deploy cloud workloads to run on internet of things (IoT) edge devices via standard containers.
548 questions
{count} votes

Accepted answer
  1. LeelaRajeshSayana-MSFT 13,871 Reputation points
    2023-09-27T01:57:13.7+00:00

    Hi @Anonymous Greetings! Welcome to Microsoft Q&A forum. Thank you for posting this question here.

    The ideal way to stop a IoT edge device module is by creating a deployment targeting the Edge device module and setting the Desired status of the module to stopped The detailed approach on how to achieve the same through Azure portal is provided in a similar question in the past. Please find the solution here - Correct way to stop and start custom modules in Azure IoT

    Now, I understand you are trying to achieve the same through .Net. In order to do that, we can leverage the deployment API. One of ways to achieve this has been shared in a similar question - Azure IoT Edge stop a module programmatically You can test this approach and make any changes per your needs.

    Hope this helps. Please let us know if you have any further questions or need any additional assistance.


    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.

    1 person found this answer helpful.
    0 comments No comments

0 additional answers

Sort by: Most helpful