How to use external letsEncrypt SSL certificate to my website on Azure vm

282 Views Asked by At

I have ASP.Net website hosted on one VM on MS Azure and connected to my website domain www.example.com on GoDaddy. I want to use letsencrypt certificate for my website. I have searched and found that I can use ssl certificate only with Web App on Azure, I have created web app and will use ssl certificate with, but still my vm url is linked with godaddy domain, hence how can I make requests coming to my website to go to my web app that is using ssl certificate, then redirect request to vm url or public IP ?

1

There are 1 best solutions below

2
On

You can install and configure the SSL certificate on your virtual machine (VM) in Azure directly if you're hosting an ASP.NET website there and would like to use an SSL certificate created with Let's Encrypt without using Azure App Service. The general steps to do this are as follows:

Obtain an SSL certificate from Let's Encrypt: To begin, get an SSL certificate from Let's Encrypt. To generate the certificate, you can use Certbot or any other ACME client. Ensure that the certificate files—fullchain.pem and privkey.pem, on average—are prepared.

  1. Make sure your ASP.NET website is prepared to use SSL by making it secure. Modify your programme to listen on port 443 (HTTPS), then set up your web server (such as IIS) appropriately.

  2. Move the privkey.pem and fullchain.pem Let's Encrypt certificate files to your virtual machine. To safely copy the data to your virtual machine, you can use programmes like SCP, SFTP, or secure copy.

You must install the SSL certificate on your virtual machine. Depending on the web server software you're using, the procedures for doing this may change. The following are some general IIS guidelines:

Start your virtual machine's IIS Manager. Choose your website from the pane on the left. Under "Edit Site," in the right pane, select "Bindings." Create a new binding using port 443, the IP address, and Type: https. Click on the "SSL certificate" dropdown menu and choose "Import." See and pick the certificate files that you transferred to the virtual machine.