I have an Azure SQL Managed Instance that is placed in VNet and I need to create an Azure VM with SSMS to connect to the Managed Instance.
What is the easiest way to configure it?
I have an Azure SQL Managed Instance that is placed in VNet and I need to create an Azure VM with SSMS to connect to the Managed Instance.
What is the easiest way to configure it?
If you already have the VNet where the instance is placed you can use the following script:
$scriptUrlBase = 'https://raw.githubusercontent.com/Microsoft/sql-server-samples/master/samples/manage/azure-sql-db-managed-instance/attach-jumpbox'
$parameters = @{
subscriptionId = '60d9f1df....'
resourceGroupName = '<resource group where the VM will be placed>'
virtualMachineName = '<name of the VM>'
virtualNetworkName = '<Virtual network name where the VM will be placed>'
subnetName = '<Name of the subnet where the VM will be placed>'
administratorLogin = '<RDP user for the VM>'
administratorLoginPassword = '<RDP password for the VM>'
}
Invoke-Command -ScriptBlock ([Scriptblock]::Create((iwr ($scriptUrlBase+'/attachJumpbox.ps1?t='+ [DateTime]::Now.Ticks)).Content)) -ArgumentList $parameters, $scriptUrlBase
Parameter subnetName
is optional and the script will create new subnet if it is omitted. Do not use subnet name where the Managed Instance is placed because Managed Instances and VMs cannot be mixed in the same subnet.
See https://learn.microsoft.com/en-us/azure/sql-database/sql-database-managed-instance-configure-vm for more details.