Developer EventsWindows Azure Developer Stories
General ResourcesWindows PhoneWindows Azure
D³: LIVE & INTERACTiVE Monthly, 1st Wednesday
These postings are provided "AS IS" with no warranties, and confers no rights. You assume all risk for your use.
If you’ve started reading from this post, you’ll need to go through the previous parts before going starting this one: Introduction Part 1: Setting Up a SQL Azure Server and Database Part 2: Scripting the On-Premise Database for SQL Azure
In this part, we’ll connect to our SQL Azure database and execute some scripts required by the application.
Connect to the 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.
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 three script files required for the ASP.NET membership and profile providers required by the app. From the File menu, click on Open, and then select File. Select InstallCommon.sql.
If you haven't already done so, download the required scripts from here.
Change the database to NerdDinner and click Execute. It should run relatively quickly and executed with no problems.
Don't forget to ensure that the NerdDinner database is selected before running each script.
So 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 your 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:
Next up – creating the Cloud solution in Visual Studio 2010.