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

Create container and new folder in storage account

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.

Our bak file is ready in blob storage

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.

Restore a database to Azure SQL Managed Instance with SSMS

In next window also select “Add”

We need to select the container

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.

Sign in to Microsoft Azure and select where is the bak file in blob container

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.

I choose the bak file which I uploaded in blob in first step

In the windows choose the container, folder and the bak file that you copied in the first step.

The bak file which I uploaded in blob storage

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”.

If you want to change database name, put the name in Destination part.

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!

Restored new database from blob storage

Now if you go back to Azure Portal and head to SQL Managed instance page you can see your database in Online there.

My new managed instance database in Azure Portal

Please be aware all resrources which I use in this topic was only for testing purpose and I have deleted after this testing.