Sharing of thoughts and information is what blogging is all about. This way we can learn from each other. Post A Comment!These postings are provided "AS IS" with no warranties, and confers no rights. You assume all risk for your use.
Anthony Bartolo Twitter | LinkedIn
Pierre Roman Twitter | LinkedIn
If you’ve started reading from this post, you’ll need to go through the previous parts of this series before starting this one: Introduction
The architecture of the application calls for a SQL Azure database to store the application’s data. The developers have created the database on their on-premise development SQL Server instance and since you can’t simply detach the database from SQL Server and then attach it to the SQL Azure server, they have scripted the database for SQL Azure and have included it in the deployment package.
To find out how the on-premise SQL database was scripted for SQL Azure, see the part 2 of the developer walkthrough, Scripting the On-Premise Database for SQL Azure.
Let’s get started.
Once you get started with Cloud services, you’re going to be visiting this site often. I highly suggest bookmarking it or committing https://windows.azure.com to memory.
Provisioning the SQL Azure Server
It is recommended that you add the firewall rule right before you start working and make sure to remove it when you’re done. This just makes sure that your database(s) stay secure at all times.
The server is now provisioned. We can now see that we have one server provisioned. At a glance, we can see the server name, user, region, and the fully qualified server name. We’re going to need these later on when we connect to the server.
Creating the Database
For more information on the differences between the editions, see the SQL Azure FAQs.
That’s it! We now have a database. Let’s see what that database looks like. Go over the left navigation pane, and expand the subscription and then expand the server. There’s our database. Click on it. You’ll now see some information about the database in the right-hand side Properties pane.
If you’re interested in the online Database Manager, click on Manage from the toolbar. You can manage the database online as well as with the SQL tools that you’re already familiar with.
Connecting to SQL Azure Server
If, for some reason, you can’t see it, hover your mouse on the right-hand side of the screen until you see the cursor change to a two arrow cursor. Drag it towards the left and the Properties pane will appear.
In order to connect to the database, we’re going to need the fully qualified DNS name of the server. Highlight the value in the Fully Qualified DNS Name and press CTRL+C.
Remember, the Windows Azure Management Portal is a Silverlight application. Don’t bother trying to right-mouse click to copy because you’re just going to get the Silverlight menu.
In order to work with SQL Azure, you’ll need the SQL Server 2008 R2 management tools.
If you don’t remember the login, just flip back to the Windows Azure Management Portal and it will be in the Properties pane.
Notice the icon next to the server name? The icon is blue, indicating that the connection is to a SQL Azure server. Expand the Databases node to see our NerdDinner database.
Open the first of the developer provided scripts. From the File menu, click on Open, and then select File. Select InstallCommon.sql.
Change the database to NerdDinner and click Execute. It should run relatively quickly and execute with no problems.
That was relatively painless, right? Not too different from running scripts against your on-premise SQL Server, right? Right! Congratulations! You have now successfully deployed the SQL Azure database.
Online Database Manager
Let’s pause for a moment and look at a scenario where you may not have SQL Server Management Studio available to you. No problem. You can deploy the scripts from the online management console.
If you have a pop-up blocker, it may prevent the window from opening. Allow the window to pop-up in your pop-up blocker, and click on Manage again.
You can do pretty much everything from here. New query, tables, etc. For example, to deploy scripts:
There you have it – deployments from anywhere!
SQL Azure Deployment Completed
With that, we’re done the SQL Azure portion of our deployment. Let’s review what we did:
Let’s go back to our to do list and see what we have to do next.
Do note that you will want the SQL Server 2008 *R2* management tools to get the extra Azure-related features covered in the series.