An Azure service that is used to deploy cloud workloads to run on internet of things (IoT) edge devices via standard containers.
Hello @Bocar KANE
The symptoms point to a provisioning issue rather than a cache-node software corruption, especially since the problem persists after uninstall/reinstall and node recreation. A 44-character value in /etc/aziot/config.toml usually indicates the symmetric key is being truncated or transformed before it reaches the IoT Edge/Aziot configuration, which then causes the DPS 401 authorization failure.
Suggested troubleshooting steps
- Verify network path and DNS after the BGP change. Confirm the node can reach all required Microsoft endpoints consistently from the new routing path, including the DPS and IoT Hub endpoints used during provisioning. A routing change can expose MTU, NAT, proxy, or asymmetric-return-path issues that break provisioning even when basic connectivity looks fine.
- Check whether the registration key is being copied or parsed incorrectly. Re-enter the key manually from the portal or source of truth and avoid copy/paste through terminals, scripts, or password managers that may trim characters, wrap lines, or alter encoding. Also confirm there are no hidden spaces, line breaks, or shell-expansion issues in the script input.
- Inspect the generated
/etc/aziot/config.tomlbefore provisioning completes. Compare the expected symmetric key length with what is written to the file and confirm whether truncation happens during script generation or only after provisioning starts. If the file already contains the shortened value, the issue is in the local generation step rather than DPS itself. - Clear stale provisioning state before retrying. Remove any leftover IoT Edge/Aziot state, cached certificates, and prior MCC configuration artifacts, then rerun
uninstallmcc.shandprovisionmcc.shfrom a clean state. If possible, also reboot the host after cleanup to ensure no old services or files are reused. - Validate time synchronization and system identity. Make sure the host clock is correct and NTP is working, because time drift can interfere with auth flows and certificate-based provisioning. Also confirm the server identity has not changed unexpectedly after recreation or routing changes.
- Test from an alternate network path or temporary bypass. If possible, move the node to a different egress path or temporarily bypass the changed BGP route to see whether provisioning succeeds. If it works on the alternate path, the issue is likely network-related rather than MCC-specific.
- Run the provisioning with verbose logging and capture the exact failure point. Collect the full output from
provisionmcc.sh, IoT Edge/Aziot logs, and any related system logs to determine whether the key is truncated before the DPS call or whether the DPS call itself rejects an otherwise valid payload. That distinction will determine whether the fix belongs in the script, the network, or the backend registration. - Please provide some below details:
- Full
provisionmcc.shoutput with debugging enabled. - The exact length and redacted form of the symmetric key as written in
/etc/aziot/config.toml. - Network diagnostics from the host, including DNS resolution and outbound connectivity to the required endpoints.
- The timestamp when the node first became unhealthy, aligned to the BGP change window.
If the key is already truncated in the generated config file, escalate as a provisioning-generation defect and attach the logs plus the exact repro steps. If the generated key is correct but DPS still returns 401, focus escalation on network path validation and endpoint reachability after the BGP routing change.
I Hope this helps. Do let me know if you have any further queries.
Thankyou!