>> Learn what Azure Private Link is and how you can use
it in this episode of Azure Tips and Tricks.
You can use Azure private link to create secure connections to
Azure services or your own services and
the applications that are behind an Azure load balancer.
We'll secure connection between
an Azure SQL Server and a virtual machine.
Let's start by creating a virtual network.
The virtual machine that we'll create will
use this network. Here we go.
First, I give it a name like this
and type in an address space like this one.
Now, I'll create a new Resource group,
we'll use this for all the services that we'll create.
For location, I'll pick West Central US.
Now for the Subnet, give it a name and
also an address range like this one, and that's it.
Let's create it, okay.
Now to create the virtual machine.
First I'll select the resource group that we've
created and I'll give the VM a name.
Next, I'll select West Central US as the location,
and now I'll select Windows Server 2019 for the Image.
What's next? The username that I can use to
log in to the VM and a password for that,
and confirm the password, there we go.
I'll leave the rest as is and click "Next".
No need to change anything here,
"Next", and this looks good.
The virtual network that we've created
is selected including the Subnet,
I just have to change this and select HTTP and RDP here.
That's it. Let's create the VM and I'll skip to when it is done.
Next, we need to create the SQL database to connect to.
Here it is, and here we go.
Select the Resource group,
and here I'll give it a name,
and I'll create a new SQL Server for it.
Let's give this a name and put in a username.
I'll use this to log into the SQL server
and give it a password and also confirm the password.
Finally, I'll change the location
and let's create the server and database.
Now for the final piece,
the private end point,
let's search for private link.
There it is. This is the private link center.
From here, I can create private endpoints for
services like a SQL Server. Let's do it.
First, select the resource group,
and to give this private endpoint a name,
and I'll select West Central US here.
"Next". Now to select the SQL Server, yep,
this one, and now the server that we've created. That's it.
Let's go to the next step.
This is the virtual network that we've created.
So that's good, and I'll leave this as it is. Let's create it.
That's it. Now to test it out.
Here is the VM and I'll connect to it using the RDP file.
I just need to login and there we go.
Here we are in the remote desktop of the VM,
and I've spun up a command prompt.
Let's try NsLookup for the SQL server, and that's it.
It tells me that the private endpoint is working
because it augments the address with the private link moniker.
So let's try it.
I've already downloaded and installed
SQL Server Management Studio on the VM.
You can do that too or use
Azure Data Studio if you like, let's connect.
This is the server name and I need
SQL authentication and the username and also the password.
"Connect" and there we go.
We are connected to the Azure SQL server and database from the VM,
and you might have noticed that we didn't have to add
our IP address to the SQL server firewall to connect.
This is because we are using a private link connection that
travels over the Azure backbone instead of the public internet.
You can use Azure private link to secure your services.
Go and check it out.