Home
%3CLINGO-SUB%20id%3D%22lingo-sub-386286%22%20slang%3D%22en-US%22%3EGetting%20started%20with%20Azure%20SQL%20Managed%20Instance%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-386286%22%20slang%3D%22en-US%22%3E%0A%20%26lt%3Bmeta%20http-equiv%3D%22Content-Type%22%20content%3D%22text%2Fhtml%3B%20charset%3DUTF-8%22%20%2F%26gt%3B%3CSTRONG%3EFirst%20published%20on%20MSDN%20on%20Jan%2023%2C%202019%20%3C%2FSTRONG%3E%20%3CBR%20%2F%3E%20Azure%20SQL%20Managed%20Instance%20is%20fully%20managed%20PaaS%20version%20of%20SQL%20Server%20hosted%20in%20Azure%20cloud%20and%20placed%20in%20you%20own%20VNet%20with%20private%20IP%20address.%26nbsp%3BIn%20this%20post%2C%20I%20will%20shortly%20explain%20how%20to%20configure%20and%20create%20Managed%20Instance%20including%20network%20environment%2C%20migrate%20your%20databases%20and%20manage%20databases%20after%20migration.%20%3CBR%20%2F%3E%20%3CBR%20%2F%3E%20%3CBR%20%2F%3E%20%3CBR%20%2F%3E%20I%20will%20explain%20the%20following%20topics%20in%20this%20article%3A%20%3CBR%20%2F%3E%3CUL%3E%3CBR%20%2F%3E%3CLI%3EConfigure%20network%20environment%20where%20Managed%20Instance%20will%20be%20created%3C%2FLI%3E%3CBR%20%2F%3E%3CLI%3ECreate%20Managed%20Instance%3C%2FLI%3E%3CBR%20%2F%3E%3CLI%3EAssess%20your%20databases%20to%20check%20could%20they%20be%20migrated%3C%2FLI%3E%3CBR%20%2F%3E%3CLI%3EMigrate%20your%20databases%3C%2FLI%3E%3CBR%20%2F%3E%3CLI%3EManage%20your%20databases%20after%20migration%3C%2FLI%3E%3CBR%20%2F%3E%3C%2FUL%3E%3CBR%20%2F%3E%3CH2%20id%3D%22toc-hId-1701902075%22%20id%3D%22toc-hId-1701902075%22%3EConfiguring%20network%20environment%3C%2FH2%3E%3CBR%20%2F%3E%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Fsql-database%2Fsql-database-managed-instance-index%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%22%3EManaged%20Instance%20%3C%2FA%3E%20is%20placed%20in%20Azure%20VNet%20so%20you%20need%20to%20create%20an%20Azure%20VNet%20and%20a%20subnet%20where%20the%20instance%20will%20be%20placed.%20Although%20the%20VNet%2Fsubnet%20can%20be%20automatically%20configured%20when%20the%20instance%20is%20created%2C%20it%20might%20be%20good%20to%20create%20it%20as%20a%20first%20step%20because%20you%20can%20configure%20the%20parameters%20of%20VNet.%20%3CBR%20%2F%3E%20%3CBR%20%2F%3E%20The%20easiest%20way%20to%20create%20and%20configure%20the%20network%20environment%20is%20to%20use%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Fsql-database%2Fsql-database-managed-instance-create-vnet-subnet%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%22%3E%20Azure%20Resource%20deployment%20%3C%2FA%3E%20template%20that%20will%20create%20and%20configure%20you%20network%20and%20subnet%20where%20the%20instance%20will%20be%20placed.%20You%20just%20need%20to%20press%20the%20Azure%20Resource%20Manager%20deploy%20button%20and%20populate%20the%20form%20with%20parameters.%20As%20an%20alternative%2C%20you%20can%20use%20%3CA%20href%3D%22https%3A%2F%2Fwww.powershellmagazine.com%2F2018%2F07%2F23%2Fconfiguring-azure-environment-to-set-up-azure-sql-database-managed-instance-preview%2F%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%20noopener%20noreferrer%22%3E%20PowerShell%20script%20described%20here%20%3C%2FA%3E%20.%20%3CBR%20%2F%3E%20%3CBR%20%2F%3E%20If%20you%20already%20have%20a%20VNet%20and%20subnet%20where%20you%20would%20like%20to%20deploy%20your%20Managed%20Instance%2C%20you%20would%20need%20to%20make%20sure%20that%20your%20VNet%20and%20subnet%20satisfy%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Fsql-database%2Fsql-database-managed-instance-connectivity-architecture%23network-requirements%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%22%3E%20networking%20requirements%20%3C%2FA%3E%20.%20You%20should%20use%20this%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Fsql-database%2Fsql-database-managed-instance-configure-vnet-subnet%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%22%3E%20PowerShell%20script%20to%20verify%20that%20your%20subnet%20is%20properly%20configured%20%3C%2FA%3E%20.%20This%20script%20will%20not%20just%20validate%20your%20network%20and%20report%20the%20issues%20-%20it%20will%20tell%20you%20what%20should%20be%20changed%20and%20also%20offer%20you%20to%20make%20the%20necessary%20changes%20in%20your%20VNet%2Fsubnet.%20Run%20this%20script%20if%20you%20don't%20want%20to%20configure%20your%20VNet%2Fsubnet%20manually%2C%20and%20also%20you%20should%20run%20it%20after%20any%20major%20reconfiguration%20of%20your%20network%20infrastructure.%20If%20you%20want%20to%20create%20and%20configure%20your%20own%20network%20read%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Fsql-database%2Fsql-database-managed-instance-connectivity-architecture%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%22%3E%20Managed%20Instance%20documentation%20%3C%2FA%3E%20and%20%3CA%20href%3D%22https%3A%2F%2Fmedium.com%2Fazure-sqldb-managed-instance%2Fthe-ultimate-guide-for-creating-and-configuring-azure-sql-managed-instance-environment-91ff58c0be01%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%20noopener%20noreferrer%22%3E%20this%20guide%20%3C%2FA%3E%20.%20%3CBR%20%2F%3E%3CH2%20id%3D%22toc-hId--850254886%22%20id%3D%22toc-hId--850254886%22%3ECreating%20managed%20instance%3C%2FH2%3E%3CBR%20%2F%3E%20Once%20you%20have%20prepared%20the%20network%20environment%2C%20you%20can%20create%20your%20first%20Managed%20Instance.%20The%20easiest%20way%20to%20create%20it%20is%20to%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Fsql-database%2Fsql-database-managed-instance-get-started%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%22%3E%20use%20the%20Azure%20portal%20%3C%2FA%3E%20and%20configure%20all%20necessary%20properties.%20If%20you%20have%20not%20created%20the%20network%20environment%20as%20described%20in%20the%20previous%20step%2C%20the%20Azure%20portal%20can%20do%20it%20for%20you%20-%20the%20only%20drawback%20is%20the%20fact%20that%20it%20will%20configure%20it%20with%20some%20default%20parameters%20that%20you%20cannot%20change%20later.%20As%20an%20alternative%20you%20can%20use%20%3CA%20href%3D%22https%3A%2F%2Fblogs.msdn.microsoft.com%2Fsqlserverstorageengine%2F2018%2F06%2F27%2Fquick-start-script-create-azure-sql-managed-instance-using-powershell%2F%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%22%3E%20PowerShell%20%3C%2FA%3E%20%2C%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Fsql-database%2Fscripts%2Fsql-managed-instance-create-powershell-azure-resource-manager-template%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%22%3E%20PowerShell%20with%20ARM%20template%20%3C%2FA%3E%20%2C%20or%20%3CA%20href%3D%22https%3A%2F%2Fblogs.msdn.microsoft.com%2Fsqlserverstorageengine%2F2018%2F11%2F14%2Fcreate-azure-sql-managed-instance-using-azure-cli%2F%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%22%3E%20Azure%20CLI%20%3C%2FA%3E%20.%20%3CBR%20%2F%3E%20%3CBR%20%2F%3E%20Just%20make%20sure%20that%20you%20have%20a%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Fsql-database%2Fsql-database-managed-instance-resource-limits%23supported-subscription-types%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%22%3E%20subscription%20type%20%3C%2FA%3E%20that%20is%20allowed%20to%20create%20the%20instances.%20%3CBR%20%2F%3E%3CH2%20id%3D%22toc-hId-892555449%22%20id%3D%22toc-hId-892555449%22%3EConnecting%20to%20Managed%20Instance%3C%2FH2%3E%3CBR%20%2F%3E%20When%20you%20create%20your%20Managed%20Instance%20you%20would%20need%20to%20find%20a%20way%20how%20to%20connect%20to%20it.%20Remember%20that%20Managed%20Instance%20is%20your%20private%20service%20placed%20on%20a%20private%20IP%20inside%20your%20VNet%2C%20so%20you%20cannot%20just%20connect%20via%20some%20public%20IP%20(this%20might%20be%20changed%20in%20the%20future).%20There%20are%20several%20ways%20how%20you%20can%20setup%20connection%20to%20Managed%20Instance%3A%20%3CBR%20%2F%3E%3CUL%3E%3CBR%20%2F%3E%3CLI%3ECreate%20%3CA%20href%3D%22https%3A%2F%2Fblogs.msdn.microsoft.com%2Fsqlserverstorageengine%2F2018%2F09%2F21%2Fthe-easiest-way-to-create-azure-vm-that-can-access-your-azure-sql-managed-instance%2F%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%22%3E%20Azure%20Virtual%20Machine%20%3C%2FA%3E%20with%20installed%20SSMS%20and%20other%20apps%20that%20can%20be%20used%20to%20access%20your%20Managed%20Instance%20in%20a%20subnet%20within%20the%20same%20VNet%20where%20your%20Managed%20Instance%20is%20placed.%20VM%20cannot%20be%20in%20the%20same%20subnet%20with%20your%20Managed%20Instances.%3C%2FLI%3E%3CBR%20%2F%3E%3CLI%3ESetup%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Fsql-database%2Fsql-database-managed-instance-configure-p2s%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%22%3E%20Point-to-site%20connection%20%3C%2FA%3E%20on%20your%20computer%20that%20will%20enable%20you%20to%20%22join%22%20your%20computer%20to%20the%20VNet%20where%20Managed%20Instance%20is%20placed%20and%20use%20Managed%20Instance%20as%20any%20other%20SQL%20Server%20in%20your%20network.%3C%2FLI%3E%3CBR%20%2F%3E%3CLI%3EConnect%20your%20local%20network%20using%20express%20route%20or%20site-to-site%20connection.%3C%2FLI%3E%3CBR%20%2F%3E%3C%2FUL%3E%3CBR%20%2F%3E%3CH2%20id%3D%22toc-hId--1659601512%22%20id%3D%22toc-hId--1659601512%22%3EAssessing%20your%20databases%3C%2FH2%3E%3CBR%20%2F%3E%20Now%20when%20you%20have%20prepared%20Managed%20Instance%20you%20can%20start%20migrating%20your%20databases%20from%20SQL%20Server%20to%20cloud.%20%3CBR%20%2F%3E%20%3CBR%20%2F%3E%20First%20thing%20that%20you%20need%20to%20do%20is%20to%20ensure%20that%20there%20are%20no%20critical%20differences%20between%20your%20SQL%20Server%20and%20Managed%20Instance.%20You%20can%20find%20a%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Fsql-database%2Fsql-database-features%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%22%3E%20high-level%20list%20of%20supported%20features%20in%20Managed%20Instance%20here%20%3C%2FA%3E%20%2C%20and%20you%20can%20find%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Fsql-database%2Fsql-database-managed-instance-transact-sql-information%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%22%3E%20details%20and%20known%20issues%20here%20%3C%2FA%3E%20.%20%3CBR%20%2F%3E%20%3CBR%20%2F%3E%20Instead%20of%20reading%20documentation%20and%20searching%20for%20incompatibilities%2C%20it%26nbsp%3B%20would%20be%20easier%20to%20install%20%3CA%20href%3D%22https%3A%2F%2Fwww.microsoft.com%2Fen-us%2Fdownload%2Fdetails.aspx%3Fid%3D53595%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%22%3E%20Data%20Migration%20Assistant%20(DMA)%20%3C%2FA%3E%20.%20This%20tool%20will%20analyze%20your%20database%20on%20SQL%20Server%20and%20find%20any%20issue%20that%20could%20block%20migration%20to%20Managed%20Instance%20such%20as%20existence%20of%20FileStream%2C%20multiple%20log%20files%2C%20etc.%20If%20you%20could%20resolve%20these%20issues%2C%20your%20databases%20are%20ready%20to%20go%20to%20Managed%20Instance.%20%3CBR%20%2F%3E%20%3CBR%20%2F%3E%20Other%20way%20might%20be%20to%20script%20your%20empty%20database%20using%20SSMS%20or%20SSDT%20and%20try%20to%20create%20all%20objects%20on%20Managed%20Instance%2C%20and%20check%20would%20there%20be%20any%20errors%2C%20but%20DMA%20is%20much%20easier%20to%20use.%20%3CBR%20%2F%3E%20%3CBR%20%2F%3E%20%3CA%20href%3D%22https%3A%2F%2Fblogs.msdn.microsoft.com%2Fdatamigration%2F2018%2F08%2F06%2Frelease-database-experimentation-assistant-dea-v2-6%2F%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%22%3EDatabase%20Experimentation%20Assistant%20%3C%2FA%3E%20is%20another%20useful%20tool%20that%20can%20record%20your%20workload%20on%20SQL%20Server%20and%20replay%20it%20on%20Managed%20Instance%20so%20you%20can%20determine%20are%20there%20going%20to%20be%20any%20performance%20issues%20if%20you%20migrate%20to%20Managed%20Instance.%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Fsql-database%2Fsql-database-managed-instance-resource-limits%23instance-level-resource-limits%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%22%3ETechnical%20characteristics%20of%20Managed%20Instance%20are%20documented%20here%20%3C%2FA%3E%20%2C%20but%20DEA%20will%20enable%20you%20to%20more%20easily%20check%20does%20you%20instance%20fit%20your%20performance%20needs.%20%3CBR%20%2F%3E%3CH2%20id%3D%22toc-hId-83208823%22%20id%3D%22toc-hId-83208823%22%3EMigrating%20databases%3C%2FH2%3E%3CBR%20%2F%3E%20Finally%2C%20you%20can%20start%20migrating%20your%20databases%20from%20SQL%20Server%20to%20Managed%20Instance.%20There%20are%20several%20ways%20to%20move%20your%20database%3A%20%3CBR%20%2F%3E%3CUL%3E%3CBR%20%2F%3E%3CLI%3E%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Fsql-database%2Fsql-database-managed-instance-get-started-restore%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%22%3ENative%20restore%20%3C%2FA%3E%20functionality%20that%20enables%20you%20to%20create%20a%20backup%20of%20your%20database%2C%20upload%20it%20to%20an%20Azure%20blob%20storage%20and%20RESTORE%20database%20from%20the%20blob%20storage.%20This%20is%20probably%20the%20faster%20approach%20for%20migration%2C%20but%20requires%20downtime%20because%20your%20database%20cannot%20be%20used%20until%20you%20restore%20it%20on%20Managed%20Instance.%3C%2FLI%3E%3CBR%20%2F%3E%3CLI%3E%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Fdms%2Ftutorial-sql-server-to-managed-instance%3Ftoc%3D%2Fazure%2Fsql-database%2Ftoc.json%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%22%3EData%20Migration%20service%20%3C%2FA%3E%20is%20a%20service%20that%20can%20migrate%20your%20database%20with%20minimal%20downtime.%3C%2FLI%3E%3CBR%20%2F%3E%3CLI%3E%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Fsql-database%2Fsql-database-import%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%22%3EExporting%20and%20importing%20your%20database%20as%20.bacpac%20file%20%3C%2FA%3E%20%2C%20or%20using%20bcp%20too%20-%20but%20there%20is%20no%20big%20advantage%20of%20these%20methods%20compared%20to%20RESTORE%2FDMS%2C%20except%20if%20.bacpac%20is%20integrated%20in%20your%20DevOps%20pipeline.%3C%2FLI%3E%3CBR%20%2F%3E%3C%2FUL%3E%3CBR%20%2F%3E%20You%20can%20migrate%20up%20to%20100%20database%20on%20a%20single%20Managed%20Instance.%20%3CBR%20%2F%3E%3CH2%20id%3D%22toc-hId-1826019158%22%20id%3D%22toc-hId-1826019158%22%3EManaging%20databases%20after%20migrations%3C%2FH2%3E%3CBR%20%2F%3E%20Many%20management%20functions%20such%20as%20backups%20are%20handled%20by%20Managed%20Instance%20and%20don't%20require%20your%20involvement.%20However%2C%20there%20are%20some%20best%20practices%2C%20tools%2C%20and%20scripts%20that%20you%20might%20add%20to%20your%20Managed%20Instance%3A%20%3CBR%20%2F%3E%3CUL%3E%3CBR%20%2F%3E%3CLI%3E%3CA%20href%3D%22https%3A%2F%2Fgithub.com%2FBrentOzarULTD%2FSQL-Server-First-Responder-Kit%2Fblob%2Fdev%2Fsp_Blitz.sql%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%22%3Esp_blitz%20%3C%2FA%3E%20procedure%20from%20Brent%20Ozar%20%3CA%20href%3D%22https%3A%2F%2Fwww.brentozar.com%2Fresponder%2F%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%20noopener%20noreferrer%22%3E%20First%20Responder%20Kit%20%3C%2FA%3E%20can%20help%20you%20identify%20issues%20that%20you%20have%20in%20your%20database.%20One%20example%20is%20the%20fact%20that%20Managed%20Instance%20don't%20run%20DBCC%20CHECKDB%20on%20your%20database%20because%20this%20is%20resource%20consuming%20operation.%20Instead%2C%20Managed%20Instance%20check%20every%20backup%20and%20file%20an%20warning%20to%20Azure%20SQL%20team%20if%20any%20corruption%20is%20detected.%20However%2C%20it%20might%20be%20good%20if%20you%20could%20run%20DBCC%20CHECKDB%20periodically.%3C%2FLI%3E%3CBR%20%2F%3E%3CLI%3EMaintenance%20script%20developed%20by%20%3CA%20href%3D%22https%3A%2F%2Fgithub.com%2Folahallengren%2Fsql-server-maintenance-solution%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%22%3E%20Ola%20Hallengren%20%3C%2FA%3E%20and%20Microsoft%20%3CA%20href%3D%22https%3A%2F%2Fgithub.com%2FMicrosoft%2Ftigertoolbox%2Ftree%2Fmaster%2FAdaptiveIndexDefrag%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%22%3E%20Adaptive%20Index%20Defrag%20%3C%2FA%3E%20scripts%20can%20help%20you%20keep%20your%20indexes%20up-to-date.%20Currently%20Managed%20Instance%20don't%20automatically%20rebuilds%20your%20indexes.%3C%2FLI%3E%3CBR%20%2F%3E%3CLI%3EApply%20%3CA%20href%3D%22https%3A%2F%2Fblogs.msdn.microsoft.com%2Fsqlcat%2F2018%2F07%2F20%2Fstorage-performance-best-practices-and-considerations-for-azure-sql-db-managed-instance-general-purpose%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%22%3E%20storage%20performance%20best%20practices%20and%20considerations%20for%20General%20Purpose%20service%20tier%20%3C%2FA%3E%20recommended%20by%20Dimitri%20Furman.%3C%2FLI%3E%3CBR%20%2F%3E%3CLI%3EFind%20more%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Fsql-database%2Fsql-database-howto-managed-instance%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%22%3E%20How-to%20guides%20%3C%2FA%3E%20that%20can%20help%20you%20configure%20your%20Managed%20Instance.%3C%2FLI%3E%3CBR%20%2F%3E%3CLI%3EInstall%20Microsoft%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Fsql-database%2Fsql-database-managed-instance-create-manage%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%22%3E%20PowerShell%20and%20Azure%20CLI%20modules%20%3C%2FA%3E%20that%20can%20help%20you%20configure%20your%20Managed%20Instance.%3C%2FLI%3E%3CBR%20%2F%3E%3CLI%3E%3CA%20href%3D%22https%3A%2F%2Fdbatools.io%2F%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%20noopener%20noreferrer%22%3EDBA%20tools%20%3C%2FA%3E%20is%20a%20powerful%20PowerShell%20library%20that%20help%20you%20control%20SQL%20Server%20and%20many%20script%20can%20be%20used%20on%20Managed%20Instance.%3C%2FLI%3E%3CBR%20%2F%3E%3C%2FUL%3E%0A%20%0A%3C%2FLINGO-BODY%3E%3CLINGO-TEASER%20id%3D%22lingo-teaser-386286%22%20slang%3D%22en-US%22%3EFirst%20published%20on%20MSDN%20on%20Jan%2023%2C%202019%20Azure%20SQL%20Managed%20Instance%20is%20fully%20managed%20PaaS%20version%20of%20SQL%20Server%20hosted%20in%20Azure%20cloud%20and%20placed%20in%20you%20own%20VNet%20with%20private%20IP%20address.%3C%2FLINGO-TEASER%3E%3CLINGO-LABS%20id%3D%22lingo-labs-386286%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3ESQLServerStorageEngine%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E
Microsoft
First published on MSDN on Jan 23, 2019
Azure SQL Managed Instance is fully managed PaaS version of SQL Server hosted in Azure cloud and placed in you own VNet with private IP address. In this post, I will shortly explain how to configure and create Managed Instance including network environment, migrate your databases and manage databases after migration.



I will explain the following topics in this article:

  • Configure network environment where Managed Instance will be created

  • Create Managed Instance

  • Assess your databases to check could they be migrated

  • Migrate your databases

  • Manage your databases after migration


Configuring network environment


Managed Instance is placed in Azure VNet so you need to create an Azure VNet and a subnet where the instance will be placed. Although the VNet/subnet can be automatically configured when the instance is created, it might be good to create it as a first step because you can configure the parameters of VNet.

The easiest way to create and configure the network environment is to use Azure Resource deployment template that will create and configure you network and subnet where the instance will be placed. You just need to press the Azure Resource Manager deploy button and populate the form with parameters. As an alternative, you can use PowerShell script described here .

If you already have a VNet and subnet where you would like to deploy your Managed Instance, you would need to make sure that your VNet and subnet satisfy networking requirements . You should use this PowerShell script to verify that your subnet is properly configured . This script will not just validate your network and report the issues - it will tell you what should be changed and also offer you to make the necessary changes in your VNet/subnet. Run this script if you don't want to configure your VNet/subnet manually, and also you should run it after any major reconfiguration of your network infrastructure. If you want to create and configure your own network read Managed Instance documentation and this guide .

Creating managed instance


Once you have prepared the network environment, you can create your first Managed Instance. The easiest way to create it is to use the Azure portal and configure all necessary properties. If you have not created the network environment as described in the previous step, the Azure portal can do it for you - the only drawback is the fact that it will configure it with some default parameters that you cannot change later. As an alternative you can use PowerShell , PowerShell with ARM template , or Azure CLI .

Just make sure that you have a subscription type that is allowed to create the instances.

Connecting to Managed Instance


When you create your Managed Instance you would need to find a way how to connect to it. Remember that Managed Instance is your private service placed on a private IP inside your VNet, so you cannot just connect via some public IP (this might be changed in the future). There are several ways how you can setup connection to Managed Instance:

  • Create Azure Virtual Machine with installed SSMS and other apps that can be used to access your Managed Instance in a subnet within the same VNet where your Managed Instance is placed. VM cannot be in the same subnet with your Managed Instances.

  • Setup Point-to-site connection on your computer that will enable you to "join" your computer to the VNet where Managed Instance is placed and use Managed Instance as any other SQL Server in your network.

  • Connect your local network using express route or site-to-site connection.


Assessing your databases


Now when you have prepared Managed Instance you can start migrating your databases from SQL Server to cloud.

First thing that you need to do is to ensure that there are no critical differences between your SQL Server and Managed Instance. You can find a high-level list of supported features in Managed Instance here , and you can find details and known issues here .

Instead of reading documentation and searching for incompatibilities, it  would be easier to install Data Migration Assistant (DMA) . This tool will analyze your database on SQL Server and find any issue that could block migration to Managed Instance such as existence of FileStream, multiple log files, etc. If you could resolve these issues, your databases are ready to go to Managed Instance.

Other way might be to script your empty database using SSMS or SSDT and try to create all objects on Managed Instance, and check would there be any errors, but DMA is much easier to use.

Database Experimentation Assistant is another useful tool that can record your workload on SQL Server and replay it on Managed Instance so you can determine are there going to be any performance issues if you migrate to Managed Instance. Technical characteristics of Managed Instance are documented here , but DEA will enable you to more easily check does you instance fit your performance needs.

Migrating databases


Finally, you can start migrating your databases from SQL Server to Managed Instance. There are several ways to move your database:

  • Native restore functionality that enables you to create a backup of your database, upload it to an Azure blob storage and RESTORE database from the blob storage. This is probably the faster approach for migration, but requires downtime because your database cannot be used until you restore it on Managed Instance.

  • Data Migration service is a service that can migrate your database with minimal downtime.

  • Exporting and importing your database as .bacpac file , or using bcp too - but there is no big advantage of these methods compared to RESTORE/DMS, except if .bacpac is integrated in your DevOps pipeline.


You can migrate up to 100 database on a single Managed Instance.

Managing databases after migrations


Many management functions such as backups are handled by Managed Instance and don't require your involvement. However, there are some best practices, tools, and scripts that you might add to your Managed Instance: