Author : MD TAREQ HASSAN | Updated : 2021/01/23
Required setup
- Download and install SSMS: https://aka.ms/ssmsfullsetup (SSMS => SQL Server Management Studio)
- Download
.bak
file: AdventureWorks
For Azure SQL Managed Instance
- Create Azure Storage Acoount (general purpose v2)
- Create blob container
- Upload
.bak
file to blob container using- Azure portal (Resource groups > storage account > Blob: container > select container)
- Microsoft Azure Storage Explorer
- Managed instance can only be accessed by the same vNet resources
- Create vNet before creating Managed Instance
- Create a subnet in the vNet for Managed Instance
- Use that subnet while creating Managed Instance
- Now Managed Instance belongs to vNet:
- all resources (i.e. VMs) in the same vNet can access Managed Instance
- service endpoints will allow reources i.e. App Service to access Managed Instance (change settiings)
- Create VM and use the same vNet
- Connect to VM
Restoring process
- Managed Instance
- Get server name from properties of Managed Instance
- Connect to Managed Instance using SSMS (use SQL Server credential, because windows credential would not work from VM)
- Restore
- Notes:
- In VM, SSMS will only show URI option for
.bak
file location - You need to login using Azure credential and locate
.bak
file in blob container (see screenshots below)
- In VM, SSMS will only show URI option for
- For Azure SQL Database
- Get connection string
- Use SQL Server credential to connect
- Select
.bak
file location and restore
Restoring a sample database in a development machine
See: SQL Server - restoring a sample database