Using Console
Using CLI
az login
az account set --subscription <subscription_id>
az keyvault certificate show --vault-name <vault_name> --name <certificate_name> --query 'attributes.autoRenewalDaysBeforeExpiry'
Replace <vault_name>
with the name of the Key Vault where the certificate is stored and <certificate_name>
with the name of the certificate.
az keyvault certificate set-attributes --vault-name <vault_name> --name <certificate_name> --auto-renew-days <days>
Replace <vault_name>
and <certificate_name>
with the appropriate values, and set <days>
to the desired number of days before expiry when the certificate should be auto-renewed.
az keyvault certificate show --vault-name <vault_name> --name <certificate_name> --query 'attributes.autoRenewalDaysBeforeExpiry'
This should return the updated auto-renewal period.
exit
Using Python
DefaultAzureCredential
class:WebSiteManagementClient
class with the appropriate subscription ID and credential:web_client.certificates.get
method to retrieve the certificate details:expiration_time
property of the certificate to see if it is within the desired auto-renewal period. If not, use the web_client.certificates.create_or_update
method to update the certificate with a new expiration_time
value:your_subscription_id
, your_resource_group_name
, your_certificate_name
, desired_auto_renewal_date
, and new_expiration_date
) with your specific values.