Summary: How to Setup a Point To Site VPN to Azure.
Date: Around 2018
Refactor: 22 March 2025: Checked links and formatting.
Setting up a Point2Site VPN is something you normally would consider for people on the road or if you do not have many users. This setup will just connect my computer to my Azure tenant and is a follow-up on these previous articles: Getting Started With Azure and Active Directory Domain Controller in Azure. So far I haven't done anything else in the environment so everything will still be done from scratch. To connect my computer through a VPN to the Azure tenant we'll need a couple of things and steps to go through:
I opted to use AD CS as the source for creating the required certificates. See Active Directory Certificate Services on Windows Server 2016 if you want to know how the installation was done. See below for the creation of the specific certificates.
We need this certificate later on so follow these steps to export the Root CA certificate. Whatever you do, DO NOT EVER export the private key with it. Follow these steps:
It's not by default available in Server Manager or the Windows Administrative Tools but you can also manually start Certificates Manager by typing “certmgr.msc”. Here you can also select a certificate and export it.
Before we can create users certificates we first need users. Remember that this is completely empty environment.
TEMP: sjoerd/User4President
Close all windows to continue with the user certificates
As my laptop is not domain joined I will create a custom Certificate Template with the required settings. Follow these steps:
Now you need to issue this certificate template so it can be used:
Now we a little challenge due to the lab environment. The easiest way to export the certificate is as the user but we only have a domain controller and users are not allowed to log onto a domain controller. To work around this we temporarily add the user to the Domain Administrators group:
Now use the user to log on to the domain controller. When logged in, follow these steps to publish the required certificate:
Now we can finally export the user certificate. Again in Certificate Manager, you now see that a certificate is issued to you by the BYOS template:
To make sure it all works for normal users now remove the user account again from the Domain Admins group:
Now as this is a follow-up on Getting Started With Azure and Active Directory Domain Controller in Azure there is already a Virtual Network that I can use. I do however want a separate subnet for my VPN clients so they are not in the same subnet as the Domain Controller. I also need a GatewaySubnet and the actual VPN for Azure, called a Virtual Network Gateway.
Every manual says create a client subnet. However, so far I have not discovered what for.
Follow these steps to create a new subnet:
Follow these steps to create a new gateway subnet:
I've added the Virtual Network Gateway to my favorites, but if you don't find it in the services overview and follow these steps to add one:
The Client Address Pool is the pool of IP addresses from which clients that connect will receive an IP address. Follow these steps to configure one:
Follow these steps to add the Root Certificate to the Virtual Network Gateway:
Note: I got errors saying the data for the certificate was invalid. For some reason only the first line of the copied data is pasted, so you need to remove all the linebreaks before you paste the certificate data. I other words, put all the lines of the certificate in one line and then paste it.
After you've done the twp previous steps it's possible to download the VPN Client. Still in the Point-to-site configuration of the Virtual Network Gateway click Download VPN Client to start the download:
Make sure you select the correct package. For 64-bit clients you need the AMD86 package:
Now it's time to setup the client. There are two things we need, the downloaded VPN Client and the exported client certificate. Make sure you also have the password the private key of the user certificate was protected with.
Follow these instruction to install and check the VPN Client:
Simply doubleclick the client certificate, which will start the “Welcome to the Certificate Import Wizard”:
Do not modify any of the settings.
Enter the password for the private key when prompted:
Now doubleclick on the VPN icon and click connect:
Click connect again in the pop-up window and allow it to change your route table while going through the first time connection. Accept everything that is suggested. Afterwards it will show that it is connected:
Then test a ping towards the domain controller:
And it also shows in Azure:
So now it works. You just created a Point2Site VPN connection to azure.