You are here
Home > SQL > Azure Databases – Restore Local Database To Azure

Azure Databases – Restore Local Database To Azure

Azure Databases – What do you need to do if you have a local database and you want to deploy it to Azure? I saw while researching for this article that there were a few ways to do this, but the method I’m going to show you is a nice quick and easy method. 

Azure Databases Created From Local Copy

To illustrate this I created a SQL database on Azure. Just select the Quick Create option.

Create Azure Databases

Enter a suitable name for the database, select your subscription and server.

New Azure Databases

Your newly created database will now be listed under your databases list on Azure. Click on the database name.

Azure Database List

You will now see the database dashboard, and to the bottom you will see the server name listed.

Azure Database Server Instance

Start your copy of SQL Server Management Studio and connect to your server as set up on Azure, entering the server name and Login credentials.

SSMS

SQL Server Management Studio will now list the database you created earlier on Azure. As you can see, there are no tables yet.

Azure Databases

The next step is to connect to your local SQL Server instance.

Azure Databases

Once you have done that, you will see your Azure and the Local SQL Server instance listed. Expanding the local database tables, you will see the tables we want to script on the Azure instance.

Azure Databases

Right click the local database and select Tasks -> Generate Scripts.

Azure Databases

The script generator will now start. In this instance I have selected to script the entire database.

Azure Databases

Before you create the script, click on the ‘Advanced’ button.

Azure Databases

Under the advanced options, be sure to select to script the database for SQL Azure.

Azure Databases

In my example, I chose to only script the schema but you can script the schema and or data.

Azure Databases

After you are done, create the script.

Azure Databases

The next step is to select the Azure database in SQL Server Management Studio and drop the script file in the editor window to open the script up against the Azure database.

Azure Databases

Hit F5 and execute the created script.

Azure Databases

When the script execution completes, you will see the created database tables in the Azure database.

Azure Databases

And to make sure that it all worked, log on to your Azure server and view the tables on your Acme database.

Azure Databases

As you can see, getting your local database on Azure is really simple and all the tools are built right in to SQL Server Management Studio.

Dirk Strauss
Dirk is a Software Developer and Microsoft MVP from South Africa. He loves all things Technology and is slightly addicted to Twitter and Jimi Hendrix. Apart from writing code, he also enjoys writing human readable articles. "I love sharing knowledge and connecting with people from around the world. It's the diversity that makes life so beautiful." Dirk feels very strongly that pizza is simply not complete without Tabasco, that you can never have too much garlic, and that cooking the perfect steak is an art he has yet to master.

Similar Articles

Top