[MUSIC]
>> Hi, and welcome to another episode of Data Exposed.
I'm Jeroen, and in this short video,
I'll explain to you how you can
import database from a BACPAC file.
Importing a database, so how did we do that?
Well, the first thing you need is a BACPAC file,
so you need to create
a BACPAC file from any database you already have,
like a SQL database somewhere.
Then, we'll make sure to upload a database into Azure.
I'll show you where you need to upload it.
Then I'll also show you how to import it.
Then at the end of this video,
you will have your database restored or imported
into Azure SQL database, so let's just get started.
So first off, I assume you created
the BACPAC file, so you have it.
Then what you need to do is,
you create a storage account if
you don't already have one in Azure,
just a regular storage account,
and then you upload that BACPAC file in your storage account.
It doesn't really matter which tool you choose.
You could use Azure Data Storage Explorer,
ASI Copy, anything you could even go
into the portal and just click "Upload" here.
As you can see on my screen, you could do that.
It doesn't matter which one you pick.
Make sure to upload it as a block blob, though.
As you can see here, the block type needs to be that.
Otherwise, you might run into trouble later.
So now, you should have
your BACPAC file uploaded to a storage account you have access to.
Next up, you need to create a SQL Server.
We call it a logical server.
It's a logical grouping for databases in Azure.
If you already have a SQL database in Azure,
your really have one of these.
If not, just create an empty one. You'll need it.
You'll need it to go into this logical server,
this logical grouping and then click "Import" here
to do the database import,
so that should be there.
So once you have it,
you go into the management pane for this.
You don't click "New Database".
Remember, we're trying to restore or
import a database from a BACPAC file that we created,
so we're not clicking "New" here.
That will basically give you a new database or one from a sample.
We're not doing new full, new data warehouse.
The one we're looking for is "Import
Database". So we're going to go here.
Then, I can switch subscriptions if I have my storage accounts in
a different subscription and
the database server that I'm restoring to.
Then, I need to provide the storage account details,
so I'll just search for my storage account.
You will have to find the storage account where you
uploaded your BACPAC file.
You need to go into the container,
and then you're going to select the BACPAC file that you want to
restore from. Hit "Select".
You can change pricing tier here.
You can definitely do that.
I'll recommend you look into which one is the right one,
so you're immediately restoring to the correct one.
For now, I'll just continue with the default.
You have to specify a unique database name on the server,
so it doesn't have to be globally unique,
but on this logical server, it needs to be unique.
Let me just do Data Exposed
and then what I need to do is I need to provide it
the password for my logical server admin.
So this is the password that you
specified when you create a logical server.
We need this to just restore the database to the logical server.
It's not related to anything that might be inside of the BACPAC,
like users or whatever.
That's not included here.
This is just the admin
that has the permission to restore the database onto the server.
Click "Okay", and in a couple minutes,
you'll see the status rolling here.
In a couple of minutes, you'll have your database restored
unto your SQL server in Azure,
and that's how simple it is.
So I hope this was useful.
Please, like and subscribe to
the channel or leave us a comment
on what you would like to see next,
and I hope to see you next time. Thanks.
[MUSIC]