How to check Azure Device Update has successfully connected

Abigail Greentree 0 Reputation points
2024-05-29T20:06:00.0233333+00:00

I am using Azure Device Update agent version 1.1.0.

Is there a programmatic way to test is the update agent has successfully connected to the hub? I am looking to implement a fallback strategy that confirms the ADU agent has re-established a connection with IoT Hub before an update is considered successful.

Running /usr/bin/AducIotAgent --health-check does not work for this use case, because that appears to succeed if the agent starts and can retrieve a connection string -- but does not confirm a connection can be made (example, if the device no longer has any network connection - the health check will still succeed).

Azure IoT
Azure IoT
A category of Azure services for internet of things devices.
400 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Pinaki Ghatak 4,535 Reputation points Microsoft Employee
    2024-07-08T08:22:20.1466667+00:00

    Hello @Abigail Greentree

    To check if the Azure Device Update agent has successfully connected to the hub, you can use the following steps:

    1. Log in to the machine or device that has the Device Update agent installed.
    2. Open a Terminal window, and enter the command below to check the status of the agent: shell sudo systemctl status deviceupdate-agent If the agent is running successfully, you should see status OK.
    3. You can also check the diagnostics tab of Device Update in the Azure portal to view the health of your devices. In the Azure portal, navigate to your IoT hub, select Updates from the navigation menu, then select the Diagnostics tab. Expand the Find missing devices section to view the results of agent check.

    Regarding your fallback strategy, you can confirm that the ADU agent has re-established a connection with IoT Hub before an update is considered successful by checking the status of the agent using the above steps after the update has been applied. If the agent is running successfully, it means that the ADU agent has re-established a connection with IoT Hub and the update is considered successful. Running /usr/bin/AducIotAgent --health-check may not work for this use case because it only checks if the agent starts and can retrieve a connection string but does not confirm a connection can be made.


    I hope that this response has addressed your query and helped you overcome your challenges. If so, please mark this response as Answered. This will not only acknowledge our efforts, but also assist other community members who may be looking for similar solutions.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.