In this comprehensive article, I’ll walk you through everything you need to know how to create Azure SQL managed instance, covering multiple methods and best practices to ensure a smooth deployment.
Table of Contents
Create Azure SQL Managed Instance
Prerequisites
Before you start, ensure you have the following:
- An active Azure subscription.
- Necessary Azure permissions (Owner or Contributor role on the subscription or resource group).
- An existing or planned Azure Virtual Network (VNet) configured with subnet(s) that meet Azure SQL MI requirements.
- Basic knowledge of Azure Portal, PowerShell, or Azure CLI.
Different Methods
There are three primary ways to create an Azure SQL Managed Instance:
- Using the Azure Portal
- Using Azure PowerShell
- Using Azure CLI
Each method suits different user preferences and automation needs. I’ll guide you through all three.
Approach 1: Using the Azure Portal
To create Azure SQL Managed Instance, follow the steps below
1. Log in to the Azure portal (https://portal.azure.com/)
2. Search for the Azure SQL and select the Azure SQL option.

3. Click on the + Add button on the Azure SQL window.

4. On the select SQL deployment option window, click the Create button from the SQL managed instances section.

5. The Create Azure SQL Database Managed Instance window will open now. Fill out the mandatory information required on the Basics tab.
- Subscription: Choose your correct subscription.
- Resource group: You can choose an existing resource group or create a new one by clicking the “Create new” link.
- Managed Instance name: Provide a name for the managed instance.
- Region: Select the region you belong to.
- Compute + storage: Select the default or configure a new one by clicking on the Configure Manage Instance link per your business needs.
- Managed Instance admin login: Provide a username for the login.
- Password: Provide a password as per the password policy
- Confirm Password: Confirm the same Password.
Click the Next: Networking > button to go to the Networking tab.


6. On the Networking tab, fill in the optional options as per the business need.
- Virtual network: Select a valid virtual network, create a new one, or select the default one.
- Connection type: You can choose a proxy(Default) option or a redirect connection type.
- Public endpoint (data): Select the Enable option here.
Click on the Next: Additional settings > button to navigate to the Additional settings tab.


7. Fill in the optional options per the business need on the Additional Settings tab.
- Collation: Select the desired collation for your managed instance. You can click on ‘Find a Collation’ to choose a new one, or you can keep the default one as well.
- Time zone: Select the time zone you belong to.
- Use as failover secondary: Choose Yes for this option.
Now click the Next: Tags button to go to the Tags tab.

8. On the tags tab, you can keep the default option. Click on the Next: Review + Create > button.

9. Finally, click on the Create button.

As you can see, the deployment has been successful.

Now, to verify if the Azure SQL-managed instance has been created, you can open your resource group as shown in the screenshot below.

Approach 2: Using Azure PowerShell
Step 1: Open PowerShell and Log in
Connect-AzAccountStep 2: Define Variables
$resourceGroup = "myresgrp"
$location = "East US"
$miName = "azurelessonsmi"
$vnetName = "azurelessons-vnet"
$subnetName = "azurelessons-subnet"
$adminLogin = "sqladmin"
$adminPassword = ConvertTo-SecureString "Password@1234" -AsPlainText -ForceStep 3: Create Resource Group (if needed)
New-AzResourceGroup -Name $resourceGroup -Location $locationStep 4: Create Virtual Network and Subnet
$vnet = New-AzVirtualNetwork -ResourceGroupName $resourceGroup -Location $location -Name $vnetName -AddressPrefix "10.0.0.0/16"
Add-AzVirtualNetworkSubnetConfig -Name $subnetName -AddressPrefix "10.0.1.0/24" -VirtualNetwork $vnet
$vnet | Set-AzVirtualNetworkStep 5: Create Managed Instance
New-AzSqlManagedInstance -Name $miName `
-ResourceGroupName $resourceGroup `
-Location $location `
-SubnetId $vnet.Subnets[0].Id `
-AdministratorLogin $adminLogin `
-AdministratorLoginPassword $adminPassword `
-SkuName "GP_Gen5_4" `
-StorageSizeInGB 512After executing the above PowerShell script, the Azure SQL managed instance was created successfully, as shown in the screenshot below.

Approach 3: Using Azure CLI
Step 1: Log in to Azure CLI
az loginStep 2: Set Variables
RESOURCE_GROUP="azurelessons-RG"
LOCATION="eastus"
MI_NAME="azurelessonsmi"
VNET_NAME="azurelessons-vnet"
SUBNET_NAME="azurelessons-subnet"
ADMIN_USER="sqladmin"
ADMIN_PASS="Password@1234!"Step 3: Create Resource Group
az group create --name $RESOURCE_GROUP --location $LOCATIONStep 4: Create Virtual Network and Subnet
az network vnet create --resource-group $RESOURCE_GROUP --name $VNET_NAME --address-prefix 10.0.0.0/16
az network vnet subnet create --resource-group $RESOURCE_GROUP --vnet-name $VNET_NAME --name $SUBNET_NAME --address-prefix 10.0.1.0/24 --delegations Microsoft.Sql/managedInstancesStep 5: Create Managed Instance
az sql mi create --name $MI_NAME --resource-group $RESOURCE_GROUP --location $LOCATION --admin-user $ADMIN_USER --admin-password $ADMIN_PASS --vnet-name $VNET_NAME --subnet $SUBNET_NAME --sku-name GP_Gen5_4 --storage 512Conclusion
In this Azure tutorial, we discussed
- How to create Azure SQL managed instance
Whether you prefer the Azure Portal, PowerShell, or Azure CLI, the process is simple and straightforward as mentioned in this article.
I hope you have enjoyed this article !!!
You may like following Azure tutorials
- How to create an Azure SQL database
- Azure SQL Managed Instance Monitoring
- Azure SQL Database Vs. SQL Server
- How To Upload SQL Database To Azure
I am Bijay, a Microsoft MVP (10 times) having more than 17 years of experience in the software industry. During my IT career, I got a chance to share my expertise in SharePoint and Microsoft Azure, like Azure VM, Azure Active Directory, Azure PowerShell, etc. I hope you will learn from these Azure tutorials. Read more
