Why is Azure IoT Central Disconnecting My Clients Every 5 or 10 minutes?

Jamie Fraser 25 Reputation points
2025-04-04T13:21:54.6666667+00:00

Hi All,

I am configuring an MQTT client that sends data to Azure IoT Central every 10 seconds. The client is using a DeviceID and SharedAccessKey to authenticate, which it does successfully and data is being sent to Azure.

However, every 5 or 10 minutes (and it is either 5 or 10 minutes (approximately), which is in itself odd to me) Azure disconnects the client and the client then has to connect again; which it is always successful in doing.

The disconnection starts with what is shown in Wireshark as an Encrypted Alert, then a short time later Azure starts the FIN handshake and the connection is terminated.

Unfortunately due to the fragmented industry I work in I have no access to the Azure side, and can only try to work with those that manage Azure by email. I feel that this issue is something that will be very obvious to many people, but I am struggling to find the cause.

I have read that there might be a CLI parameter called du that is passed during key generation, but my contact suggests this is not being passed so maybe it defaults to something short like du=300 (secs)? But, I am also confused as to why sometimes the client is disconnected after 5 minutes, but other times it is disconnected after 10 minutes - so far I have not been able to determine a pattern.

Any help would be greatly appreciated.

Thanks

Azure IoT Central
Azure IoT Central
An Azure hosted internet of things (IoT) application platform.
375 questions
{count} votes

Accepted answer
  1. Sampath 2,675 Reputation points Microsoft External Staff Moderator
    2025-04-21T10:04:31.8133333+00:00

    Hello @Jamie Fraser ,

    The client being disconnected by Azure IoT Central approximately every 5 or 10 minutes and the presence of TLS Encrypted Alerts followed by FIN packets it suggests that the Shared Access Signature (SAS) token expiry time is the root cause.

    Azure IoT Central uses SAS tokens for device authentication. These tokens include an expiry time (expressed as the number of seconds since the Unix epoch). If the SAS token has a short duration , Azure will gracefully disconnect the client once the token expires, even if the client is still actively sending telemetry.

    Ensure that the SAS token generated on the client side has a longer expiry time . The maximum supported duration is 365 days, but you can safely start with at least a few hours (e.g., 3600–86400 seconds) for testing.

    image

    If you are not generating the SAS token yourself (e.g., the client is using a third-party stack), ask your client-side team or vendor to verify or extend the token duration.

    Reference this MSDOC for more details :

    Please don’t forget to click “Accept the answer” and “Yes” if the information helped you. This can be beneficial to other community members facing similar issues.

    If you need further clarification, feel free to reply in the comments.

    1 person found this answer helpful.
    0 comments No comments

0 additional answers

Sort by: Most helpful

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.