Book Image

Microsoft SQL Azure Enterprise Application Development

By : Jayaram Krishnaswamy
Book Image

Microsoft SQL Azure Enterprise Application Development

By: Jayaram Krishnaswamy

Overview of this book

SQL Azure is a database service in the cloud. Based on Microsoft’s Windows Azure platform, SQL Azure is well suited for web facing database applications. Are you interested in moving your business applications and data to the cloud but are not sure how to go about it? Look no further; this book covers all you ever wanted to know about taking your relational enterprise data to the cloud using SQL Azure. This book will show you how to manage SQL Azure using various tools and also guide you in developing enterprise applications and business intelligence solutions. It will take you through migration and synchronization scenarios with a variety of tools, help you in working with Microsoft technology still in incubation, and in leveraging hybrid applications that exist partially in the cloud and partially on the ground.This step-by-step tutorial begins by providing an overview of Cloud Computing, introducing you to the most significant Cloud Computing implementations. You will then learn the mechanics of signing up and obtaining an account on Microsoft Windows Azure and logging into the portal.The book then dives deep into SQL Azure, showing you how to provision a SQL Azure Server, and how to create/delete databases as well as set up Firewall rules so that you can access SQL Azure from tools/Client programs. It is then followed by details of how to access SQL Azure using Client and Server APIs.Other content includes, a comprehensive description of tools required to access SQL Azure and how to use them and how to populate and migrate SQL Azure databases using a variety of tools.Finally, the book will detail with examples, data-centric applications that leverage a mix of on-site data and Cloud based data, how to synchronize data and extend the applicability of SQL Azure data by disconnected applications on mobile media, and synchronize services for globally distributed data. After covering the topics of services which are in production, the book will then cover future developments as well as a complete update to SQL Azure at the time of writing this book.
Table of Contents (17 chapters)
Microsoft SQL Azure: Enterprise Application Development
Credits
About the Author
Acknowledgement
About the Reviewers
www.PacktPub.com
Preface

Getting started with Azure Platform and accessing services


In order to work with this book it will be necessary to have an account for using the Windows Azure Platform. This is not a free service starting from February 1, 2010. During January 2010, this was a free service for evaluation but since February 1 it is a service you can subscribe to and a number of different subscription plans are available. Presently, you need to purchase a subscription to use this service. Exercise 1.1 describes the steps you need to take for purchasing the subscription. Exercise 1.2 describes the steps for accessing the services purchased by accessing the Azure Portal. In particular, a hosting service will be created. The actual hosting will be described in Chapter 7, Working with Windows Azure Hosting. The access to SQL Azure (Chapter 2, SQL Azure Services) and AppFabric (Chapter 8, Database Applications on Windows Azure Platform Accessing SQL Server Databases) from the portal will be described later.

Exercise 1.1: Purchasing a subscription on Windows Azure Platform

There are various subscription options available for purchase and each business has to make a choice suitable for its needs. For the initial parts of this book the choice made is described here. There are three parts to this process shown as follows:

Signing up for a Windows Live ID

  • Purchasing a subscription

  • Activating the Service

Signing up for a Windows Live ID

The following assumes a new sign up. If you already have a login for Windows Live ID this step is not necessary.

  1. 1. Go to the following URL: http://home.live.

  2. 2. Click on Sign up to open the URL: https://signup.live.com/signup.aspx?id=251248&ru=http%3a%2f%2fhome.live.com%2f%3fnew%3dtrue&cp=2&mkt=en-US&rollrs=12&lic=1 as follows.

  3. 3. Fill in the required details. You may have to check and see if it is available. If your first choice is not successful you can try again until you get an ID. You have to provide demographic information and provide a strong password. You also need to agree to the service agreement by clicking the I Accept button (not shown in the previous screenshot).

  4. 4. If everything is OK a Windows Live ID account will be created. You may review the account information from one of the links on this page. You can sign out of the account on this page clicking Sign out at top right.

Purchasing a subscription

To purchase a subscription, go to the following URL and choose an offer that is suitable for you: http://www.microsoft.com/windowsazure/offers/. The various options are shown in the following screenshot (follow previous URL to see the complete page):

  1. 1. For this book, the first option was chosen.

  2. 2. Click on the Buy button. You will be taken to the Microsoft Online Services page (URL: https://login.live.com/login.srf?wa=wsignin1.0&rpsnv=11&ct=1283982570&rver=5.5.4177.0&wp=SAPI&wreply=https:%2F%2Fmocp.microsoftonline.com%2Fsite%2Fbuy%2FMS-AZR-0001P&lc=1033&id=255559) where it is assumed you have already created a windows Live ID login.

  3. 3. Enter your password and click OK. This will take you to the My Profile page of your account, as shown, where you need to provide a few more pieces of information about your physical address and telephone number.

  4. 4. Click on the Next button. This will bring you to the Company Information page where you need to fill in a few more required items.

  5. 5. Click Next. This will take you back to the Service Usage Address page of My Profile.

  6. 6. Click Finish. This will take you to the Confirmation page of My Profile.

  7. 7. Now click Close on this URL link. This will take you to the Microsoft Online Services' Customer Portal where you can review the services, subscriptions, and so on as shown here: https://mocp.microsoftonline.com/Site/ShoppingCartPage.aspx.

  8. 8. Check the Customer acknowledgement regarding the agreement. Keep a copy for your files.

  9. 9. Click Checkout >. This will take you to the Billing Information wizard's Payment Options Page. Herein, you can use a Credit Card (New) or provide a purchase order number.

  10. 10. Click Next on this page. Provide the Credit card information here.

  11. 11. Click Next. You are once again taken to the Microsoft Online Subscription Agreement page where you again need to agree to the terms. You also provide the full customer name and a title.

  12. 12. Click the I Accept button. This will bring you to the Review and Confirm Order page of Billing Information.

  13. 13. Click Confirm. This brings up the Confirmation page with a confirmation number, which you can file for your records.

  14. 14. Click on Proceed to activation.

Activating the service

The previous action will take you to the service activation page. You need to provide a subscription name. This name will be used for the subscription as well as to provide a name for the first project with the Windows Azure Platform. The Service name is mapped to the billing information. Here is an example from Service Activation with the subscription name: mysorian.

  1. 1. Click Next. This will take you to the Service Administrator page, which will show the Windows Live ID and contact information of the Administrator.

  2. 2. Click Next. This will take you to the summary page as shown in the following screenshot. Note the Azure portals that will be provisioned for the mysorian subscription.

  3. 3. Click Finish. This brings you to the Confirmation page.

  4. 4. Click Close. The Online Services page comes up showing the status as Activation in Progress.

Now you are subscribed. You should check up your subscription status at the following URL: https://mocp.microsoftonline.com/Site/Manage.aspx.

Exercise 1.2: Accessing Windows Azure Portal

Now, we will access the Windows Azure Portal. Herein, although you can set up your project for all the three components of the Platform, you will only set up your Windows Azure Hosting Service as follows:

  • Verifying status of account and browsing to Windows Azure Portal

  • Creating an account and reviewing the portal

  • Creating a Windows Azure Service

In the next chapter, you will be setting up the SQL Azure Services from the same portal.

Verifying status of account and browsing to Windows Azure Portal

To verify the status of your account, you will need to complete the following steps:

  1. 1. Browse to the following URL: https://mocp.microsoftonline.com/Site/Manage.aspx.

    You will notice that the status has changed to Service Active. Herein, you can edit both the Service as well as the Billing details as follows:

  2. 2. Browse to the following Windows Azure portal: http://windows.azure.com to display the New Account page as follows.

    This page shows the components of the Windows Azure Platform, Windows Azure, SQL Azure, AppFabric, and Marketplace. From this page you may access the Billing information; review your projects as well as sign out of live.com. Notice that the developer portal account is tied to Windows Live ID. Read the privacy statement, which provides useful information regarding the services provided as well as where to get help if needed (Windows Azure Platform Support: http://www.microsoft.com/windowsazure/support/). Marketplace is not discussed in this book but it is a direct contender to one of the services offered by SalesForce.com.

Creating an account and reviewing the portal

To create an account and review the portal, you will need to do the following:

  1. 1. Click I Agree. You get a congratulatory message to the effect that your account has been created.

  2. 2. Click Continue. Voila, your portal is ready with the Project Name that you provided during setting up the service account as shown. You are in the Windows Azure Page of your services portal. The three components will all be associated with the same Project Name as all of them are Enabled.

Creating a Windows Azure Service

You can add services to your project as described here.

  1. 1. Click on the hyperlink under Project Name to open the Windows Azure Project page as follows.

    Here, you can create a New Service as well as a Marketplace Listing. For the purposes of this book you need not create a Marketplace Listing. However, you will be hosting applications in the Windows Azure cloud platform and, therefore, you will be creating a New Service. When you create a New Service, provisioning of various resources will be made for your project. This is also the place where you can find more information on Windows Azure as well as access the various forums where you can pose questions and hopefully find answers.

  2. 2. Click +New Service at either one of the locations shown on the previous screenshot. This will display the following page:

    There are two accounts that you can set up here, a Storage Account and an account for the Hosted Services. You can see that you can set up 5 Storage Accounts and 20 Hosted Services accounts. You must remember that these are all billable and use caution while setting up the accounts. For the purposes of this book we will not be setting up a Storage Account.

  3. 3. Click Hosted Services. This opens the Project's Create a Service page where you provide a Service Label and a Service description, which will be used only on developer portal as follows:

  4. 4. Click Next. This takes you to the Hosted Service page. Herein, you will need to provide a name for the publicly accessible name for the service (you may need to ascertain the availability) as well as the Hosted Service Affinity Group. For the purposes of this book, this is not of any great concern. However, if you are using Storage or any other bandwidth sensitive items, you may want to keep your data and application in the same region. Here, mysorian has been used for the Service URL and Anywhere US for the Affinity Group.

  5. 5. Click Create. The details of the Hosted Service created will be displayed as follows.

    When you create a project that you want to host on Windows Azure, this is where you will come to deploy. Applications hosted on Production are live and publicly accessible. In practice, you may want to test and verify the application on a Staging server. Windows Azure has this provision.

  6. 6. Click on the Vertical bar on the right with an arrow pointing left in the previous screenshot to display the following:

    You first deploy to Staging, which is not public and after you are satisfied you can bring it over to Production. When you deploy the application to Staging a new control will be spawned, which will allow you to transfer the application to Production. You can also manage certificates that you upload and by default there are no certificates. Whether you deploy your application to Staging or Production you will be charged and the amount charged will depend on the plan you choose.

  7. 7. Sign out of the portal. We will host a number of applications in Chapters 7, Working with Windows Azure Hosting and Chapter 8, Database applications on Windows Azure Platform accessing SQL Server databases. We will set up the SQL Azure Service in the next chapter.