0

Azure SQL database - Managed Instance must be placed in Azure VNet in dedicated subnet within the VNet. There are some special requirements that VNet and subnet must satisfy that are described here: https://medium.com/azure-sqldb-managed-instance/the-ultimate-guide-for-creating-and-configuring-azure-sql-managed-instance-environment-91ff58c0be01

What is the easiest way to check is the existing Azure VNet/subnet configured according the requirements and to fix issues/configure VNet/subnet in order to deploy Managed Instance in the existing VNet/subnet?

Jovan MSFT
  • 13,232
  • 4
  • 40
  • 55
  • copy\paste documentation day? – 4c74356b41 Jan 18 '19 at 06:06
  • There are some concrete questions that are not easily discoverable in the official documentation, and also some people prefer to search for an answer on stack-overflow instead of browsing documentation toc and reading all documentation. I'm adding here some questions that people are asking although they are documented, hoping that thye will more easily find the answer. – Jovan MSFT Jan 18 '19 at 08:41
  • yeah sure, a great service – 4c74356b41 Jan 18 '19 at 08:43

1 Answers1

1

In Azure docs is described how to configure existing VNet/subnet to deploy Managed Instances in them - see https://learn.microsoft.com/en-us/azure/sql-database/sql-database-managed-instance-configure-vnet-subnet

You should use the following script and put subscription id, VNet and subnet names:

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

Script has the following steps:

  • Validate - Selected virtual network and subnet are validated for Managed Instance networking requirements
  • Reports & confirm - Script shows a set of changes that need to be made to prepare subnet for Managed Instance deployment and asked for consent
  • Prepare - Virtual network and subnet are modified by the script and configured properly.
Jovan MSFT
  • 13,232
  • 4
  • 40
  • 55
  • Is there an alternative to this script, it seems to fail for no apparent reason with errors like: "Exception calling "ToUInt32" with "1" argument(s): "Input string was not in a correct format."" ... this is during the routing table part of the validation. – Traiano Welcome Mar 22 '19 at 07:34
  • This script also fails with "Network Security Group doesn't have supporting Security Rule for Network Intent Policy Security Rule: Name: mi-sql-management-inbound" ... not sure if it works anymore ? – Traiano Welcome Mar 22 '19 at 08:11