Azure IOT hub Status "Bad Credential"

Nishanth Sahaya 0 Reputation points
2025-10-17T14:57:03.7366667+00:00

Hello,

My application is "Rockwell PLC (MODBUS)-->Teltonika RUT241--> Azure Cloud.

I have recently purchased the IOT gateway and configured the devices yesterday. The data was flowing yesterday, and containers were updating every 2 minutes. Then I turned off the device, and in the morning device is ON but not receiving data in the Azure storage also, notice that the Azure IOT connected device is 0.

In the teltonika device, the "Azure IoT Hub status is BAD CREDENTIAL" I added three different Azure IOT devices from different Azure clouds, but the gateway's status is the same. I have verified the SAS token; it is all correct. Is it something wrong with the gateway? or Azure is not accepting the data from the Gateway for some reason?

Azure Internet of Things
{count} votes

1 answer

Sort by: Most helpful
  1. Manas Mohanty 11,850 Reputation points Microsoft External Staff Moderator
    2025-10-17T18:08:49.46+00:00

    Hey Nishanth Sahaya

    The “BAD CREDENTIAL” status on your Teltonika RUT241 indicates that the gateway is failing to authenticate with Azure IoT Hub. Since you’ve already verified the SAS token and tried multiple IoT Hub devices, the issue is likely related to one of these areas:

    Common Causes & Fixes

    1. SAS Token Expiry

    • SAS tokens have a validity period (often 1 hour to 7 days depending on how they were generated).
    • If the device was powered off overnight, the token may have expired. Fix: Regenerate a new SAS token from Azure IoT Hub and update it in the Teltonika configuration.

    2. Device Identity or Policy

    • Ensure the IoT Hub device identity is enabled and not disabled in Azure.
    • Check if the IoT Hub access policy (SharedAccessKey) matches the credentials used by the gateway.

    3. Time Synchronization

    • IoT Hub authentication depends on accurate device time.
    • If the gateway’s clock drifted while powered off, the SAS token signature will fail. Fix: Sync the Teltonika device time via NTP or manually set the correct time.

    4. Connection String Format

    Verify that the connection string or credentials entered in the gateway match Azure’s format exactly:

    HostName=<your-hub>.azure-devices.net;DeviceId=<device-id>;SharedAccessSignature=<SAS-token>
    

    5. TLS/SSL Certificates

    • Azure IoT Hub requires TLS 1.2 and valid root certificates.
    • If the gateway lost certificates or firmware settings during power-off, it may fail to establish a secure connection. Fix: Check firmware version and ensure certificates are present.

    How to Troubleshoot Further

    In Azure Portal

    • Go to IoT Hub → Devices → [Your Device] → Overview and confirm status is enabled.
    • Check IoT Hub metrics for failed connection attempts.

    On Teltonika

    • Review system logs for authentication errors.
    • Confirm NTP settings and time zone.

    Hope it helps.

    Thank you

    0 comments No comments

Your answer

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