Table of Contents

Setup a Point To Site VPN to Azure

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:

Configure Active Directory Certificate Services

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.

Export the Root CA Certificate

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:

pointtositevpnazure01.jpg


pointtositevpnazure02.jpg


pointtositevpnazure03.jpg


pointtositevpnazure04.jpg


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.

Create Users and Groups

Before we can create users certificates we first need users. Remember that this is completely empty environment.

TEMP: sjoerd/User4President

pointtositevpnazure11.jpg


Close all windows to continue with the user certificates

Export the User Certificate

Create a Custom Certificate Template

As my laptop is not domain joined I will create a custom Certificate Template with the required settings. Follow these steps:

pointtositevpnazure05.jpg


pointtositevpnazure06.jpg


pointtositevpnazure07.jpg


pointtositevpnazure08.jpg


pointtositevpnazure09.jpg


pointtositevpnazure10.jpg


pointtositevpnazure12.jpg


pointtositevpnazure13.jpg


Issue the Certificate Template

Now you need to issue this certificate template so it can be used:

pointtositevpnazure14.jpg


pointtositevpnazure15.jpg


pointtositevpnazure16.jpg


Add User to Domain Admins

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:

Enroll User Certificate

Now use the user to log on to the domain controller. When logged in, follow these steps to publish the required certificate:

pointtositevpnazure17.jpg


pointtositevpnazure18.jpg


pointtositevpnazure19.jpg


pointtositevpnazure20.jpg


pointtositevpnazure21.jpg


Export User 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:

pointtositevpnazure22.jpg


pointtositevpnazure23.jpg


pointtositevpnazure24.jpg


pointtositevpnazure25.jpg


pointtositevpnazure26.jpg


pointtositevpnazure27.jpg


Remove the User from Domain Admins

To make sure it all works for normal users now remove the user account again from the Domain Admins group:

Azure Network Requirements

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.

Create a Client Subnet

Every manual says create a client subnet. However, so far I have not discovered what for.

Follow these steps to create a new subnet:

pointtositevpnazure28.jpg


pointtositevpnazure29.jpg


Create a Gateway Subnet

Follow these steps to create a new gateway subnet:

pointtositevpnazure30.jpg


pointtositevpnazure31.jpg


Create a Virtual Network Gateway (VPN)

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:

pointtositevpnazure32.jpg


pointtositevpnazure33.jpg


Add the Client Address Pool to the Virtual Network Gateway

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:

pointtositevpnazure34.jpg


pointtositevpnazure35.jpg


Add the Root Certificate to the Virtual Network Gateway

Follow these steps to add the Root Certificate to the Virtual Network Gateway:

pointtositevpnazure36.jpg


pointtositevpnazure37.jpg


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.

Download VPN Client

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:

pointtositevpnazure38.jpg


Make sure you select the correct package. For 64-bit clients you need the AMD86 package:

pointtositevpnazure39.jpg


Setup Client

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.

Install the VPN Client

Follow these instruction to install and check the VPN Client:

pointtositevpnazure40.jpg


pointtositevpnazure41.jpg


Install the Client Certificate

Simply doubleclick the client certificate, which will start the “Welcome to the Certificate Import Wizard”:

pointtositevpnazure42.jpg


Do not modify any of the settings.

Enter the password for the private key when prompted:

pointtositevpnazure43.jpg


Connect to Azure

Now doubleclick on the VPN icon and click connect:

pointtositevpnazure44.jpg


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:

pointtositevpnazure45.jpg


Then test a ping towards the domain controller:

pointtositevpnazure46.jpg


And it also shows in Azure:

pointtositevpnazure47.jpg


So now it works. You just created a Point2Site VPN connection to azure.

Useful Links