Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Execute RenewCertificate ok but not stored renewed certificate #33

Open
M0nter0 opened this issue Dec 7, 2023 · 0 comments
Open

Execute RenewCertificate ok but not stored renewed certificate #33

M0nter0 opened this issue Dec 7, 2023 · 0 comments

Comments

@M0nter0
Copy link

M0nter0 commented Dec 7, 2023

Hello and thanks for sharing this code with the community.

I've deployed the template and it is running.
Everyday the task runs AutoRenewCertificate successfully, but I've noticed the certificate in the KeyVault/Certificates is not replaced.

Trying to understand what is failing I've run the task manually, and checking the log in verbose mode I see the following (snippet simplified)

[Information] Executing 'AutoRenewCertificate' (Reason='This function was programmatically called via the host APIs.', Id={guid})
[Information] Renewing certificate at: 12/7/2023 2:20:14 PM
[Information] C# HTTP trigger function processed a request.
[Information] {} - Request: GET .... {{keyvaulturl}}/secrets...
[Information] Executed 'AutoRenewCertificate' (Succeeded, Id={guid}, Duration=13140ms)

Checking LetsEncrypt.cs I think it never runs it Task Run() as I don't see neither of the logs

if (cert == null || cert.Certificate.NotAfter < DateTime.UtcNow.AddDays(renewXNumberOfDaysBeforeExpiration)) //Cert doesnt exist or expires in less than renewXNumberOfDaysBeforeExpiration days, lets renew.
{
    logger.LogInformation("Certificate store didn't contain certificate or certificate was expired starting renewing");
    ...
}
else
{
    logger.LogInformation("Certificate expires in more than {renewXNumberOfDaysBeforeExpiration} days, reusing certificate from certificate store", renewXNumberOfDaysBeforeExpiration);
   ...
}

Am I missing something?
How could I get more info about what is failing?

Thanks a lot

@M0nter0 M0nter0 changed the title Executede RenewCertificate but not Execute RenewCertificate but not stored renewed certificate Dec 7, 2023
@M0nter0 M0nter0 changed the title Execute RenewCertificate but not stored renewed certificate Execute RenewCertificate ok but not stored renewed certificate Dec 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant