Configure App Service Certificate to Azure Virtual machines
App Service Certificate can be used for other Azure service and not just App Service Web App. This tutorial shows you how to secure your web app by purchasing an SSL certificate using App Service Certificates , securely storing it in Azure Key Vault , domain verification and configuring it your virtual machine . Before your begin log in to the Azure portal at https://portal.azure.com
Step 1 : Create an Azure Virtual machine with IIS web server
Create an Azure virtual machine with IIS from Azure marketplace or with Azure CLI .Step 2 : Add a Custom domain to your virtual machine
Purchase a new domain and assign it your Azure virtual machine. For more details , click here .Step 3 : Place an SSL Certificate order
You can place an SSL Certificate order by creating a new App Service Certificate In the Azure portal. Enter a friendly Name for your SSL certificate and enter the Domain Name in Step 1 . DO NOT append the Host name with WWW.
Step 4 - Store the certificate in Azure Key Vault
Key Vault is an Azure service that helps safeguard cryptographic keys and secrets used by cloud applications and services. Once the SSL Certificate purchase is complete, you need to open the App Service Certificates page. The current status of the certificate is “Pending Issuance” . Complete the steps below to have an active certificate ready to use.
Click Certificate Configuration inside the Certificate Properties page and Click on Step 1: Store to store this certificate in Azure Key Vault.
From the Key Vault Status page, click Key Vault Repository to choose an existing Key Vault to store this certificate OR Create New Key Vault to create new Key Vault inside same subscription and resource group.
Note : Azure Key Vault has minimal charges for storing this certificate. For more information, see Azure Key Vault Pricing Details.
Once you have selected the Key Vault Repository to store this certificate in, the Store option should show success.
Step 5 : Verify the domain ownership
From the same Certificate Configuration page you used in Step 3, click Step 2: Verify. Choose the preferred domain verification method.
There are four types of domain verification supported by App Service Certificates: App Service, Domain, Mail, and Manual Verification. These verification types are explained in more details in the Advanced section.
Step 6 : Assign certificate to Virtual machine
Before performing the steps in this section dedicated for Virtual machine , you must have :
- associated a custom domain name with your app on the virtual machine. For more information, see Configuring a custom domain name for a web app.
- Make sure Key Vault has appropriate permissions to be used with Virtual machine . For more information , see Using MSI with Key Vault on Virtual machine
Here are the instructions to assign the certificate to the virtual machine
-
-
Get the Key Vault information for your SSL certificate resource under certificate configuration.
-
Prepare and Configure the virtual machine to add the Certificate.
-