LetsEncrypt on AZURE


#1

I have been trying to get the LetsEncrypt Certificate authenticated against an NEW PORTAL Azure Web App.
I am generally linux based in everything I do so I do not have access to .Net tools, VB etc. What I want is to be able to serve a simple Node.js app as an Azure Web App. The issue I found was that the manual method using
./letsencrypt-auto certonly --manual
asks me to put a string value in a file named
e.g.
MK5z-Em6euwwmVJ2L2k4dP0j1uY3prfsbtGEg-MFErE
so that externally I can see
http://mywebsite.uk/.well-known/acme-challenge/MK5z-Em6euwwmVJ2L2k4dP0j1uY3prfsbtGEg-MFErE
unfortunately I found by trial and error that I can only access the contents of this file if it has a file extension
MK5z-Em6euwwmVJ2L2k4dP0j1uY3prfsbtGEg-MFErE.txt or .html or .anything
Without an extension AZURE WEB APP refuses to show it, as (I assume) .Net is objecting to the length / structure or the filename. Would it be possible to have the manual test check for
Eom9wcjqOqLlLsjQ85F9TszSp6XfDuIj8U3fAeo6rH4.html
I am aware of the Azure Let’s Encrypt plugin - but again not being .Net myself means I do not have the tools to generate the data required, and the ./letsencrypt-auto certonly --manual approach is so much simpler to use.


#2

The direct answer is that Azure Web Apps are based on IIS, and IIS will only serve files with extensions that exists in its MIME map, and the MIME map can be extended in your web.config file. As you need to serve an extensionless file, it is a bit of a pest, but certainly possible. It is discussed here:

ebekker shows how it’s done

<?xml version="1.0" encoding="UTF-8"?>
 <configuration>
     <system.webServer>
         <staticContent>
             <mimeMap fileExtension=".*" mimeType="text/json" />
         </staticContent>
     </system.webServer>
 </configuration>