Open fildanrcs opened 5 years ago
I had this same problem and here is how I got it to work. First off, I think this only applies to Azure Functions so I'm not sure that there is much here for someone running a web app. My setup is a an Azure Function that uses proxies to call a different Storage account that is setup as a static website. When you click the button for the Lets Encrypt extension to get a certificate at some point in the process it loads a file onto your site that it then requests is from .well-known\acme-challenge. 2 problems, 1) I never saw a folder with that name in my static website, and 2) the real problem, Azure functions can't serve files without extensions, which that challenge file is. So I tried to see if there was a config setting that would allow Azure functions to serve files without extensions, but there is not one I can find. To fix it 2 things need to be done, and you can read more about it here https://matt-roberts.me/lets-encrypt-on-azure-appservices-with-local-cache/ . In your static website create a new container called 'letsencrypt-challenge', and then add these two entries in your Azure Function application settings
letsencrypt:AuthorizationChallengeBlobStorageAccount : your connection string to your static website storage container
letsencrypt:AuthorizationChallengeBlobStorageContainer : letsencrypt-challenge
next you need to create a proxy on your Azure function to the challenge folder like this:
Route Template: /.well-known/acme-challenge/{*restOfChallenge}
https://[yourstaticwebsitehere].blob.core.windows.net/letsencrypt-challenge/.well-known/acme-challenge/{restOfChallenge}
Once I did this, I could see that the Lets Encrypt extension was able to create a file in the new letsencrypt-challenge container that I had made, and it was able to serve up the extension-less file to complete the challenge.
@ewild, thanks for referencing this blog post. It was down the moment I tried to reach the post, but still available in Google cache.
Especially helpful for me was the mentioned change of the URL:
Then, in your code that calls the site extension API, rather than call
letsencrypt/api/certificates/challengeprovider/http/kudu/certificateinstall/azurewebapp
, change that toletsencrypt/api/certificates/challengeprovider/http/blob/certificateinstall/azurewebapp
.
@sjkp, could you please add this important information concerning the API Blob endpoint to the docs as well?
P.S.: Your site extension works perfectly - thanks a lot for all your work! 😃
Hi, I've read a lot of issues out there but I have not found one similar to my case. What I'm having trouble with is that with Azure Functions, after I've configured the function and the proxy, I trigger the extension (No Job) and then I see the call coming to the function and the proper code catched in the function. But I get this log in the function:
and the result of the extension links to this error:
This is the code of the function "renewcert":
And the proxy JSON:
It seems like the extension somehow is not able to create the file in acme-challenge folder. Can you please help me with this?
Thanks in advance!