Jean Paul's Blog

There are 2 types of People in the World, One who Likes SharePoint and..

  • Microsoft MVP

  • MindCracker MVP

  • CodeProject MVP

  • eBook on SharePoint 2010

  • eBook on Design Patterns

  • eBook on Windows Azure

  • NLayers Framework @ CodePlex

  • MSDN Forums

  • .Net vs. Java

    Due to Public Demand
  • Advertisements

Posts Tagged ‘sql azure’

Windows Azure – Create new SQL Azure Server and Database

Posted by Paul on November 13, 2011

Now we can proceed with creating the database in the azure account. The steps involved in this are following.

  • Create new subscription
  • Create new server
  • Create new database

New subscription is already created and we can reuse it. So we can proceed with the next 2 steps.

Create new server

Sign in to the windows azure portal and click the Database category from the left pane as shown below.


Wait for a few seconds and you will be getting the main pane ready as below:


Click on the Create a new SQL Azure Server item from the above screen. The following screen appears.


In the above dialog select the Subscription and click next to continue.


In the above screen select the Region and click Next to get the next screen.


In the above screen enter the administrative login and password. (The usual names like sa, admin etc. are reserved and entering is not allowed)

Note: On entering a valid login name and passwords only, the Next button will get enabled.

On clicking next, we get the following screen.


Use the Add button to add the IP address range. We need to enter the range for getting client access to the server. For demonstration I have entered to 255. 255. 255. 255 to open all IP get access to it.

Now click the Finish button.

You can open the subscription item from the left top pane to see the new server and default databases inside it. You will be provided with a master database with read only access to it.


Create a new Database

Now we can proceed with creating our database. To achieve this click on the Create button from the top ribbon as shown below.


The following dialog box appears:


Enter the database name you prefer and select the default options for other entries, click Ok button.

You are now ready with the new database.


Now we are ready with the new database. In the upcoming articles we can see how to use the database using ADO.NET classes.


In this article we have seen how to create a database server and database in SQL Azure. You can find more information on SQL Azure here.


Posted in C# | Tagged: , , , , | Leave a Comment »

Windows Azure – SQL Azure Introduction

Posted by Paul on November 13, 2011

Remembering from the storage type article, the 3 types of storage were:

  • Local Storage
  • Windows Azure Storage
  • SQL Azure Storage

In this article we are emphasizing on SQL Azure Storage. The important features are listed and we will be creating an database in the online storage account.

The features are mentioned below:

  • SQL Server equivalent in Cloud
  • Built on SQL Server Technologies
  • No installation needed
  • Transact SQL Support
  • ADO.NET and ODBC drivers supported
  • Available anywhere
  • Existing .Net Database skills are reusable here
  • Easier Scalability
  • Highly Fault Tolerant
  • Pricing involved


Note: The Sql Azure can be accessible from Azure applications as well as other applications like ASP.NET, Console Applications. Also the complete SQL Features are not available in SQL Azure. You can find more info here.

Features Explained

We can relate everything in our windows/ world to azure world. The Sql Azure is the Sql Server equivalent in the cloud. There will be a server, database and connectivity using ADO.NET which we are familiar with. (Creation of server and database are discussed in the upcoming article.)

Connecting using ADO.NET

We can use the existing ADO.NET SQL Server classes to connect and manipulate the SQL Azure database.










The SQL Azure database will be replicated on multiple servers and is more fault tolerant than the SQL Server database.

The automatic switching of server in case of server fault makes the SQL Azure have increased availability.

SQL Azure helps the database management easier by freeing up from:

  • Server Operating System Setup Overheads
  • SQL Server Setup Overheads
  • Scalability Setup Overheads

In the pre SQL Azure world, we need to setup the database server with the appropriate operating system, install the sql server, configure the server etc. But in SQL Azure we are free from all these overheads. This makes concentrating in the core aspects of the application.

In the SQL Azure, scalability is an easier task otherwise in Sql Server we have to deal with replication server configuration, principal and mirror server configuration etc. We can scale up and down based on the requirements of the application.

More information can be found here
Types of Database

In the SQL Azure there are two types of databases:

  • Web Edition
  • Business Edition

The Web Edition is the basic edition and right choice for a typical web application. This Database provides up to 5 GB of T-SQL based relational database. This edition is best suited for Web application, and Departmental custom apps.

The Business Edition SQL Azure DB provides up to 50 GB of T-SQL based relational database. This edition is best suited for Software as a Service applications, custom applications etc.


The billing also varies based on the edition. In our examples we will be using the Web Edition only.

Posted in C# | Tagged: , , , , , | Leave a Comment »

Windows Azure Platform Management Tool (MMC)

Posted by Paul on November 13, 2011

In this article, I would like to introduce a tool useful while developing Windows Azure applications.

The Platform Management Tool is a desktop application and it allows the developers to manage:

  • Hosted Services
  • Perform Diagnostics
  • Certificates
  • Storage Services
  • Blob, Table, Queue
  • Command Based Operations


The latest tool can be downloaded from

Source Code

The source code of the tool is available here.

Using the MMC

Download the tool and execute the setup.


The files will be extracted to the specified folder. Now execute the StartHere.cmd file from location C:\WindowsAzure\MMC. The following wizard will appear.


Click Next to continue and it will do a scan of the system.


If all the required software found the status will be green. Click Next to continue and the installation will be started. A command window will be prompted like below:


Now press any key to continue and within few seconds the installation will be completed. The following screen will be visible.


The MMC tool will be automatically started as below. (You can also launch it from the desktop icon)


Expand the Windows Azure Management item and click on the Service Management item.


Enter your Subscription ID in the appearing dialog. (Subscription ID can be retrieved from the Windows Azure Portal)

Then Click on the API Certificate button. Your certificate will be automatically populated in the appearing dialog as shown below: (If no certificates are listed, then you need to create and add certificate into your azure account. This is explained the previous article)


Select the certificate and click Ok.

Now click Connect from the right pane as shown below:


Wait for a while and you will be connected to the service. Now you can explore the hosted services, storage services by clicking the respective item from the left pane.

The figure below shows the content of Blob Containers.



In this article the MMC tool was introduced. It should be noted that the Storage functionalities of the tool can be achieved with the Server Explorer of Visual Studio.

Posted in C# | Tagged: , , , , | Leave a Comment »

Create Table in Storage Account

Posted by Paul on November 6, 2011

In this article we can explore the table creation in storage account.

As a refresh, I would like to repeat that there are 3 types in Azure Storage

  • Blob
  • Table
  • Queue

The Blob creation was explored in the previous article. Table creation will be explored here.

Concepts in Table

Following are the key concepts in table.

  • Tables allow structure data storage
  • There can be 0..n tables in a storage account
  • Table store data as a collection of entities
  • Entity have a primary key and properties as key value pair

Note: The table we discuss here is not entirely same as our database table. The database table will be discussed in SQL Azure. In Blob Service, the data is stored in containers. But in Table Service, data is stored in tables.

The steps involved in creating a table are following:

Step 1:Create new project

As always create a new azure project and add a web role into it. Now add reference to the StorageClient dll file.


Step 2: Define the Entity

Now we need to define the entity with the required properties, create a new class, derive it from TableStorageEntityand define the following properties in it.

Our entity class is derived from TableStorageEntitybecause this class takes care of the key properties like PartitionKey, RowKey and necessary attributes.

Step 3: Code Part

Now we can write the code to do the following activities:

  • Do account authentication
  • Create Table client
  • Create table in account
  • Add the new entity to tabl

The following code performs the following:

protected void Page_Load(object sender, EventArgs e)


StorageCredentialsAccountAndKey accountAndKey = new

StorageCredentialsAccountAndKey("youraccount", "key");

CloudStorageAccount account = new CloudStorageAccount(accountAndKey, true);

CloudTableClient client = account.CreateCloudTableClient();


TableServiceContext tableContext = new



Contact contact = new Contact();

contact.PartitionKey = "1";

contact.RowKey = "1";

contact.Name = "Contact1";

contact.Address = "Address1";

tableContext.AddObject("Contact", contact);



The account name and key can be obtained as explained in the previous article.

Note: We are setting the PartitionKey and RowKey as “1” for demo purposes. The PartitionKey represents the partition identifier where the table is stored. The RowKey should be the unique identifier to the entity. More Info

The classes involved for resembles the ADO.NET Entity Framework classes.

Step 4: Viewing the entity inserted

You can use the Server Explorerto see the new entity inserted as shown below.



In this article we have seen how to define a table and insert entity into it.

Posted in Azure | Tagged: , , , | Leave a Comment »