HOW TO
An Azure SQL Managed Instance (MI) provides a complete SQL Server instance hosted in Azure. It is built specifically to bridge the gap between traditional on-premises environments and the cloud. It operates at the instance level, allowing you to host, group, and manage multiple databases together under one roof.
It is deployed directly into an isolated, dedicated Azure Virtual Network (VNet) with a private IP address, providing native network security and isolation. Azure SQL Managed Instances are best suited for "Lift-and-shift" migrations. If you have legacy applications running on an on-premises SQL Server and want to migrate to Azure without rewriting application code, MI provides near 100% feature compatibility.
In an on-premises deployment of SQL Server, the database backups are read directly from local disks or network drives to restore their content on a SQL Server Instance. However, in an Azure SQL Managed Instance, the process of database restoration is directly performed from an Azure Blob Storage via the RESTORE FROM URL command:
Below is a complete overview of the steps involved in restoration workflow:
RESTORE DATABASE FROM URL command.




-- Replace <StorageAccountName>, <ContainerName>, and <YourSASToken>
IF NOT EXISTS (
SELECT * FROM sys.credentials
WHERE name = 'https//<StorageAccountName>.blob.core.windows.net/<ContainerName>'
)
BEGIN
CREATE CREDENTIAL [https//<StorageAccountName>.blob.core.windows.net/<ContainerName>]
WITH IDENTITY = 'SHARED ACCESS SIGNATURE',
SECRET = '<YourSASTokenWithoutLeadingQuestionMark>';
END;
GO

RESTORE HEADERONLY
FROM URL = 'https//<StorageAccountName>.blob.core.windows.net/<ContainerName>/<YourBackupFileName>.bak';
GO

RESTORE DATABASE [YourRestoredDatabaseName]
FROM URL = 'https//<StorageAccountName>.blob.core.windows.net/<ContainerName>/<YourBackupFileName>.bak';
GO


Article ID: 000043455
Get help from ArcGIS experts
Start chatting now