Add certificate auto-renewal capability to TRE certificate shared service #4702
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Overview
This PR implements automatic certificate renewal functionality for the TRE certificate shared service, addressing the need for hands-off certificate management in production environments. The feature uses Azure Logic Apps to monitor certificate expiry and automatically trigger renewals before certificates expire.
Problem Statement
Previously, TRE administrators had to manually monitor certificate expiry dates and trigger renewals through the API or UI. This created operational overhead and risk of service disruption if certificates expired unexpectedly. The manual process was particularly challenging for:
Solution
The implementation adds three new configurable parameters to the certificate service template:
enable_auto_renewal(boolean, default: false): Master toggle for auto-renewal functionalityrenewal_threshold_days(integer, 1-60, default: 30): Days before expiry to trigger renewalrenewal_schedule_cron(string, default: "0 2 * * 0"): Schedule for checking certificate expiryWhen enabled, the system deploys an Azure Logic App that:
Key Features
Secure Architecture
Flexible Configuration
Production Ready
Technical Details
Infrastructure Components
Integration Points
/shared-services/{id}/invoke-action?action=renewAPI endpointTesting
The implementation includes comprehensive testing coverage:
Documentation
Added complete documentation including:
Example Usage
Deploy a certificate with auto-renewal enabled:
{ "templateName": "tre-shared-service-certs", "properties": { "display_name": "Nexus Certificate with Auto-renewal", "domain_prefix": "nexus", "cert_name": "nexus-ssl", "enable_auto_renewal": true, "renewal_threshold_days": 30, "renewal_schedule_cron": "0 2 * * 0" } }The system will automatically check the
nexus-sslcertificate every Sunday at 2 AM and trigger renewal when it has 30 or fewer days until expiry.Backward Compatibility
This change is fully backward compatible:
Migration Path
Existing certificate services can enable auto-renewal by upgrading to version 0.8.0 and updating their configuration to include the new auto-renewal parameters. The upgrade process maintains existing certificates and settings while adding the new automation capability.
Original prompt
Fixes #4701
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.