I am a little newbie in cloud computing, so …
I’ve decided to document all my steps in Azure and the other technology.
I you want to start learning step by step Azure DB, just follow !
Ok, enough ………….. (that’s enough about myself!)
Have you ever create local database in SSMS(SQL Server Manager Studio ), NO – YES ?
Anyway, if you want to migrate database schema with data to Azure, so it’s right website!
We are going to:
- Use Data-Tier Applications
- Create Microsoft Azure Storage
- Create BACPAC
- Migrate BACPAC to Azure SQL server
Setting up a local SQL Server database
So just, open SSMS. Then, dialog window will appear on the screen. Just choose your Local DB Server.
Please copy T-SQL code from my repository:
In SSMS just choose New Query and paste everything. Next, Execute. It’s creating WineDB with three tables (Wine, Customer, Order).
Next, paste and run code from github file, which inserts data to WineDb
You can see WineDb and tables in the Object Explorer after quick refresh.
Data-Tier Applications (DACs, BACPAC) – what is it ?
Data-Tier Applications (DACs) provide a simple but powerful way to develop, deploy, and manage
database and instance objects. DAC enables developers to package SQL Server and SQL Database
objects into a single DAC package (a .dacpac file) for convenient deployment across development,
test, and production environments.
A BACPAC is a Windows file with a .bacpac extension. The data in a BACPAC is stored in JSON format. A BACPAC is more efficient with Microsoft Azure’s.
Microsoft Azure Storage
To migrate data to SQL Database using BACPAC, you first need to create a .bacpac file from your
on-premises SQL Server database and upload it to a blob container in Microsoft Azure Storage.
This section walks you through these steps.
If you want to learn more about how to create Azure storage, I invite you to watch this Youtube Video
Click Storage accounts in Azure home section.
Then create storage account.
Here is my configuration.
Ok! We’ve just created Azure storage!
Now is time to add Blob Container
Just go to Storage accounts,
next choose your storage -> Storage Explorer (preview)->
Right click on Blob Containers -> Create blob container ->
Type Name and Public access level set to Private
Create BACPAC and Export to Azure
Ok, we have only a few steps, so stay curious and open SSMS.
Right click on WineDb-> Tasks-> Extract Data-tier Application …
- Introduction click Next
- Export Settings-> Settings ->(choose, radio button) Save to Microsoft Azure
- Click Connect … and Sign In … Azure, after than select Storage and Blob Container – > next
- Summary -> Finish
- Voilà – Done
Importing BACPAC to Azure SQL Server
Do you have SQL server on Azure ?
If you don’t know about Azure SQL and don’t have SQL Server, I invite you to this website
Otherwise follow article.
First find your SQL Server on Azure, then click Import database
The most important is Storage and Pricing tier
Storage – find your blob and choose WineDB
Pricing tier – you can find your preferences (I always choose low costs 5 Basic, about 4 euro/ month)
Wait, a few minutes and enjoy your WineDb database on Azure
Now you can use this knowledge to develop database projects on Azure.
Or, just query WineDb. It’ good practice BTW.
Maybe you can play with SQL using Query editor on Azure.
Thank for your attention!
Please put more smile in digital world 😉