Skip to content

Commit 74b7d72

Browse files
committed
Expand Edge CA renewal guidance and add troubleshooting entry
- Expand 'Plan for Edge CA renewal' section with timing table, restart sequence details, and module resilience best practices - Add troubleshooting entry for custom modules losing connectivity after Edge CA certificate renewal - Link to IoT Hub SDK retry documentation for connection resilience Addresses recurring community issue (Azure/iotedge#7497, #7321, #6044, #6008, #7446) where custom modules stop sending messages after the 30-day Edge CA renewal cycle.
1 parent 3e4646e commit 74b7d72

2 files changed

Lines changed: 48 additions & 3 deletions

File tree

articles/iot-edge/how-to-manage-device-certificates.md

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ titleSuffix: Azure IoT Edge
44
description: How to install and manage certificates on an Azure IoT Edge device to prepare for production deployment.
55
author: sethmanheim
66
ms.author: sethm
7-
ms.date: 03/23/2026
7+
ms.date: 04/13/2026
88
ms.topic: concept-article
99
ms.service: azure-iot-edge
1010
services: iot-edge
@@ -396,7 +396,28 @@ You can provide your own certificates and manage them manually. However, to avoi
396396

397397
When the Edge CA certificate renews, it regenerates all the certificates it issued, like module server certificates. To give the modules new server certificates, IoT Edge restarts all modules when the Edge CA certificate renews.
398398

399-
To minimize the potential negative effects of module restarts, plan to renew the Edge CA certificate at a specific time (for example, `threshold = "10d"`) and notify dependents of the solution about the downtime.
399+
The renewal happens automatically based on the `auto_renew` threshold you configure. The following table shows when renewal occurs for common certificate lifetimes, using the default threshold of `80%`:
400+
401+
| Certificate lifetime | Default threshold (80%) | Renewal occurs at |
402+
|---|---|---|
403+
| 90 days | 80% | Day 72 (18 days before expiry) |
404+
| 30 days | 80% | Day 24 (6 days before expiry) |
405+
| 7 days | 80% | Day 5.6 (~34 hours before expiry) |
406+
407+
During the renewal, the IoT Edge runtime:
408+
409+
1. Regenerates the Edge CA certificate.
410+
1. Stops all running modules.
411+
1. Restarts each module so it receives a new server certificate.
412+
413+
This restart cycle causes a brief disruption. Custom modules that connect to EdgeHub must reconnect after the restart. If a module doesn't implement connection retry logic, it might fail to reestablish communication with EdgeHub and stop sending messages.
414+
415+
To minimize the potential negative effects of module restarts:
416+
417+
- **Schedule renewal for a maintenance window.** Set `threshold` to an absolute time (for example, `threshold = "10d"`) so the renewal happens at a predictable point before expiry.
418+
- **Implement connection retry in custom modules.** Modules should use the Azure IoT device SDK's built-in retry policies, or implement their own exponential backoff retry logic, to automatically reconnect to EdgeHub after a restart. For more information, see [Manage connectivity and reliable messaging by using Azure IoT Hub device SDKs](../iot-hub/iot-hub-reliability-features-in-sdks.md).
419+
- **Set the module restart policy to `always`.** In your deployment manifest, set `"restartPolicy": "always"` for each custom module so the container runtime restarts modules that fail after the certificate renewal cycle.
420+
- **Notify dependents of downtime.** If your solution has upstream services or dashboards that consume IoT Edge module telemetry, notify those dependents that a brief disruption will occur during the renewal window.
400421

401422
### Example: use Edge CA certificate files from PKI provider
402423

articles/iot-edge/troubleshoot-common-errors.md

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ title: Troubleshoot Azure IoT Edge common errors
33
description: Resolve common issues in Azure IoT Edge solutions. Learn how to troubleshoot issues with provisioning, deployment, the IoT Edge runtime, and networking.
44
author: sethmanheim
55
ms.author: sethm
6-
ms.date: 03/03/2026
6+
ms.date: 04/13/2026
77
ms.topic: troubleshooting-general
88
ms.service: azure-iot-edge
99
services: iot-edge
@@ -378,6 +378,30 @@ If you change the TTL value for your application to a value that's shorter than
378378

379379
To configure the *MessageCleanupIntervalSecs* value, set the environment variable in the deployment manifest for the IoT Edge hub module. For more information about setting runtime environment variables, see [Edge Agent and Edge Hub Environment Variables](https://github.com/Azure/iotedge/blob/main/doc/EnvironmentVariables.md).
380380

381+
### Custom modules stop sending messages after Edge CA certificate renewal
382+
383+
#### Symptoms
384+
385+
Custom modules stop communicating with EdgeHub after running for a period of time, typically around 24-30 days when using the default 30-day quickstart Edge CA certificate, or at 80% of the configured certificate lifetime. The EdgeHub and EdgeAgent modules continue to run, but custom modules can no longer send or receive messages through EdgeHub.
386+
387+
#### Cause
388+
389+
When the Edge CA certificate auto-renews, IoT Edge stops and restarts all modules so they receive new server certificates. After the restart, modules must reestablish their connection to EdgeHub. If a custom module doesn't implement connection retry logic, the module starts but can't reconnect to EdgeHub because the new EdgeHub server certificate isn't yet available or the module doesn't retry the initial connection attempt.
390+
391+
#### Solution
392+
393+
Check the EdgeAgent logs for certificate renewal events:
394+
395+
```bash
396+
sudo iotedge logs edgeAgent | grep -i "renewal"
397+
```
398+
399+
To resolve:
400+
401+
1. Verify that each custom module has `"restartPolicy": "always"` in the deployment manifest.
402+
1. Implement connection retry logic in custom modules. Use the Azure IoT device SDK's built-in retry policies, or add exponential backoff retry logic so the module automatically reconnects to EdgeHub after a restart. For more information, see [Manage connectivity and reliable messaging by using Azure IoT Hub device SDKs](../iot-hub/iot-hub-reliability-features-in-sdks.md).
403+
1. To control when the renewal disruption occurs, set the `threshold` to an absolute time instead of a percentage. For example, `threshold = "10d"` triggers renewal 10 days before certificate expiry. For more information, see [Plan for Edge CA renewal](how-to-manage-device-certificates.md#plan-for-edge-ca-renewal).
404+
381405
### IoT Edge Hub reports System.FormatException error when using AMQP protocol
382406

383407
#### Symptoms

0 commit comments

Comments
 (0)