How to Install Azure SQL Managed Instance

superior_hosting_service

Managed Instance

Step by Step Installation of the Azure SQL Managed Instance


Today in this post I am going to show you how quickly we can create SQL managed instance in Azure.

Important Pre Requisite for the SQL managed instance.

Azure SQL Database Managed Instance must be deployed within an Azure virtual network and the subnet dedicated for Managed Instances only. You can use the existing virtual network and subnet if it’s configured according to the Managed Instance virtual network requirements.

In your enterprise you need to request the network folks to create the new subnet for you before you deploy the first instance of the SQL managed instance.

A PowerShell script which will prepare the subnet is as follows.

$scriptUrlBase = ‘https://raw.githubusercontent.com/Microsoft/sql-server-samples/master/samples/manage/azure-sql-db-managed-instance/prepare-subnet’
$parameters = @{
subscriptionId = ‘<subscriptionId>’
resourceGroupName = ‘<resourceGroupName>’
virtualNetworkName = ‘<virtualNetworkName>’
subnetName = ‘<subnetName>’
}
Invoke-Command -ScriptBlock ([Scriptblock]::Create((iwr ($scriptUrlBase+’/prepareSubnet.ps1?t=’+ [DateTime]::Now.Ticks)).Content)) -ArgumentList $parameters

Once you run this command it will prepare the subnet as you can see below.

sql1

It will also add few default route as you can see. You may need a security review since it will create a route where it will point directly to internet instead of your local firewall device as shown below.

sql2

In the next step, it will attach the route to the subnet and the subnet is ready.

sql4

In the next step, you need to create a network security group and need to assign it to the subnet. As you can see below.

sql5

The NSG will have the following inbound rules and the following ports should be allowed

sql6

And the following outbound rules

Once it’s done you can start the creation of the SQL managed instance.

You can click on the plus sign in the top right corner of the portal to create a resource and search for Azure SQL Managed Instance and you can see below.

sql8

Click on the create button.

In the next step you need to choose the size of the instance

In the next step, you need to fill the managed instance details as shown below.

Initially, the first instance will take some time but don’t cancel it. You can check the progress from the notification area.

sql11

After waiting for some time you will find that the SQL Managed instance is created and ready for your use.

sql12