Home > Azure, Azure SQL Managed Instance, PowerShell, SQL Server > Azure SQL Managed Instance – Provisioning

Azure SQL Managed Instance – Provisioning

Once you have created the prerequisites, you are ready to create your first Managed Instance.  As of now, Managed Instance is only available in the following subscription types:

  • Pay-As-You-Go
  • Enterprise Agreement
  • Cloud Service Provider

Information about subscription and resource limitations can be found here.  I will update this with any changes.

For a PowerShell script to provision a Managed Instance, see the end of the post.

Add Resource

To provision a Managed Instance in the Azure Resource Manager portal, connect to your subscription and open the resource group in which you created the prerequisites.  Click the Add button at the top of the page:

A1 - AddMi

Search Resources

On the Everything page, search for Azure SQL Managed Instance and click the name in Results.

A2 - SearchMi

The portal will display an overview of the Managed Instance resource and links to Managed Instance documentation, pricing, and information about the Database Migration Service.  Confirm that you want to create a new Managed Instance and click Create.

Select Managed Instance

A3 - MiDisclaimer

Enter Managed Instance Information

In the SQL Managed Instance pane, select the subscription in which you created the prerequisite resources.  Enter a name for the Managed Instance, an admin account name, and an admin password.

NOTE: The admin password must be at least 16 characters in length.

Select the resource group and location in which the prerequisite resource exist.  If the virtual network and subnet were created successfully, the subnet that contains the route table will appear in the Virtual Network dropdown.  Select it and the pricing tier link will unlock.

A4 - MiInformation.png  

Choose Pricing Tier

I will provide more information about pricing tiers and processor generations in a subsequent post.  For this example, I will select a General Purpose Managed Instance containing 8 vCores and 32GB of storage.  Select the desired parameters and click Apply.

A5 - ConfigureMiPerformance

Create Managed Instance

At this point you are ready to create your first Managed Instance.  Note that the initial creation of a Managed Instance in a subnet can take up to 6 hours.  Click the Create button to start the process.

A6 - CreateMi

View Managed Instance

Navigate back to your resource group.  Once the Managed Instance is created, click the Managed Instance name on the Overview page.

A7 - SelectMi

Celebrate!

The Overview for the Managed Instance will display with a message that your Managed Instance is ready.  Congratulations!

A8 - MiOverview

In my next post, I will cover the process for connection to the Managed Instance and restoring a database.

<# NOTE: The initial deployment of an Availability Group to a subnet will take ~3 hours. <span 				data-mce-type="bookmark" 				id="mce_SELREST_start" 				data-mce-style="overflow:hidden;line-height:0" 				style="overflow:hidden;line-height:0" 			>&#65279;</span>Subsequent deployment will take minutes #>
<# Connect to Azure Account #>
Connect-AzureRmAccount;

<# Initialize local variables     Confirm that resource group, location, VNet, and subnet are the same    as those for the Managed Instance prerequisites #>
$resourcegroup = "yourmirg";
$location = "eastus";
$miname = "yourmi";
$vnetname = "yourmivn";
$subnetname = "default";
$subscrname = "Your Subscription"

<# Get subscription ID for the specified subscription #>
$subscrid = (Get-AzureRmSubscription -SubscriptionName $subscrname).SubscriptionId;

<# Switch to the desired subscription #>
Set-AzureRmContext -SubscriptionID $subscrid;

<# Create a new Managed Instance    This example will create a General Purpose Managed Instance    with 8 Gen4 vCores, indicated by the GP_Gen4 sku    To create a Business Critical instance with Gen5 cores    use sku BC_Gen5 #>
New-AzureRmSqlManagedInstance -Name $miname `
-ResourceGroupName $resourcegroup `
-Location $location `
-AdministratorCredential (Get-Credential) `
-SubnetId "/subscriptions/$subscrid/resourceGroups/$resourcegroup/providers/Microsoft.Network/virtualNetworks/$vnetname/subnets/$subnetname" `
-LicenseType LicenseIncluded `
-StorageSizeInGB 32 `
-VCore 8 `
-SkuName GP_Gen4

Leave a Reply

%d bloggers like this: