Adding a free Let's Encrypt certificate on Azure Web App Part 1: Registering the app
As reported in Microsoft’s Identity Platform Blog, the user experience for Azure App Registrations has changed, and the choice to use the legacy editor will not be available after March 1st. The end result is that some things in Azure Active Directory(AAD) have been moved around. So I decided that it’s time to do another series of blog posts to describe how to configure your Azure Web App with a free Let’s Encrypt certificate because AAD is an essential part of the process.
In this first post, I will go through the process of creating an App Registration inside Azure Active Directory. By the end of the series, we will have a Let’s Encrypt extension running beside our web app. Since the generated certificates will expire every three months, this extension will renew SSL certificates automatically for us.
We need a way to give the Let's Encrypt extension access to our Azure resource group so that it can manage the resources automatically for us. An Azure App Registration will enable us to create an authentication account that the extension will use to log into our Azure Active Directory.
So without further ado, let’s start our journey to make our site secure. From the Azure Portal dashboard, click on Azure Active Directory:
Then further down look for the App registrations menu, and click the + New registration button:
This will open a new window to register the app. Here we need to provide any name which we will use to identify the application (I opted to name it Let's Encrypt). The supported account type should be ‘Accounts in this organizational directory only (Default Directory only - Single tenant)’ and the redirect URI filled in with the web app’s URL.
Click the Register button and wait for the app registration to be created.
Now we need to create the actual login. Once back to the app registrations page, click on Certificates & secrets, and then + New client secret:
Give it a descriptive name and the desired expiry time.
After the secret store is created, its value will be displayed. Make sure to copy the value by hovering on the field and clicking on the copy icon as shown below. For security reasons, this value will be hidden when you try to view it in a future session (otherwise it wouldn't be a secret anymore). We will then use this secret once when configuring the Let’s Encrypt extension during the last step and dispose of the information immediately after.
Back inside the app registration window, we also need to make a note of the application id for later.
In the second step, we will give the Let's Encrypt account that we just created access to our Azure resources.