Restore managed instance database from blob storage
Let’s assume you already configured your managed instance, and you got access to the server with SSMS, now you want to restore your first database from Azure blob storage to MI.
It’s very straight forward process, for restoring database to managed instance you have several methods but in this case we assume that’s not a huge database or your organization is fine with some outage and offiline process.
Create container in Azure portal and upload the bak file in blob
I already took backup from my database on premise, I have created new storage account for this purpose then create new container in Azure Portal. see the following screenshot
My container is private and that means no one from public has access to it, then I upload the bak file which I already took from my local computer to Azure container. That’s also very simple task.
Go the folder which have created in prevoius step then click on upload button on the top.
Restore a database to Azure SQL Managed Instance with SSMS
Now the bak file in blob storage is ready to restore, lets open SSMS and connect to managed instance. Like what we do in on premise select “Backup” then like the following screenshot in Device you can see “URL” option, select this then “add” the file.
In next window also select “Add”
Then you need to “Sign in” to Microsoft Azure to be able to select your storage account and blob container which you already copied the bak file there. See the following screenshot.
After you signed in you need to select “Storage Account” then “blob storage” and at the end click on “Create credential” then click on OK button.
In the windows choose the container, folder and the bak file that you copied in the first step.
Confirm all previous windows and you’ll see the first window, you can change the database name and type what name that you want and click on “Ok”.
Depends on the size of database you need to wait sometime, then your database will ready!
Check the database in SSMS and Azure Portal.
Congratulations! Now your first database is on the cloud and you can start your work!
Now if you go back to Azure Portal and head to SQL Managed instance page you can see your database in Online there.
Please be aware all resrources which I use in this topic was only for testing purpose and I have deleted after this testing.