Our Azure app will create various projects using the
different project types available in ASP.Net Framework and host the same in
Azure. Project is intended to train the Microsoft web developers with ASP.Net
project hosting in Azure, debugging the various issues around it and how to
take advantage of Azure in various projects.
Many of the IT people are confused with Azure and ASP.net.
Whenever there is a requirement for Azure hosted web application, they think
about the normal Azure project type and missing the advantages in integrating the
ASP.net project types with Azure. Again, when there is a web application
requirement, people think about asp.net web app using web forms or web pages;
but the requirement may well suitable for ASP.Net MVC or reporting site.
LightSwitch HTML5 Client introduced a new way to create the enterprise applications, which can access from anywhere and from any device. With the new features introduced in LightSwitch, become the best choice for our GlobalMeet application design.
First Challenge: Create Windows Azure Account
Create Windows Azure account using the Azure site http://www.windowsazure.com/en-us/pricing/free-trial/?WT.mc_id=AFDB9E4DC
Using the free trial available for one month period, we can
explore the power of Windows Azure and get a better understanding about the
various features of the Azure.
Windows Azure redefines the way we work and use the
technologies. One of the best example to
illustrate the usage of Azure based cloud technology is that in old days we use
the home shelf for saving money and valuable assets. Nowadays all valuable
assets and money will be in Banks and it provides great security and easy to
access. Same way Azure is built with high security features, which will cater
the security needs of various organizations. Also, Azure provides scalable and
high performing applications with high availability. Introduction of Azure
reduced the burden to manage huge infrastructure to support the applications
and the related scalability, performance and availability issues.
Here, we will be discussing about the various features of
Azure and how we can leverage the power of Azure to support the GlobalMeet
application. As the name suggest, this site is for organizing various events across
the world. One of the requirements is the scalability of the application at
peak times to conduct multiple events with lot of attendees. Azure is the best
choice for designing the high performing event site with support to scale on
Second Challenge: Build a Web Site
Now, let us setup our Azure web site to host our GlobalMeet
application. Login to Azure portal (http://www.windowsazure.com)
and select “Portal” to view the management portal. Open the Azure management
portal to view all existing items like websites, databases, Virtual machines,
etc. Select the Web Sites item from the left side list and then select the
“New” icon displayed left bottom side.
This will open the New wizard with options to create a new
There are three options to create a web site- Quick create,
Custom Create and From Gallery.
Let us create our globalmeet site using the
Quick create option. Specify the website name, select appropriate region and
the subscription from the list of subscriptions.
Select the Create Web Site option from the bottom right
Let us verify the custom create option now.
This option will help us to create a custom web site with options to connect to
existing database and integrate with source control system. If you have a team
working on the project and the source code version using a source control
system like TFS, we can integrate the source control system to deploy the site
to the new web site directly.
Specify various options like web site name, subscription,
region, and database name and connection details. Once you select the Publish
from source control option, the wizard will launch the second page to capture
the source control system details.
Select the appropriate source control system from the list
of options like TFS, Git, CodePlex, etc. Once you select the Source control
system, it will display the options to connect to the selected source control
system. Following screen shot is for connecting to the TFS server.
Choose this option to create a website using
the web applications available in the gallery. Once you select this option to
create a new web site, you will get the list of applications from the gallery.
Select one application suitable for your need and continue
to configure your web site
We have created our globalmeet web site using the quick
create option. Now let us see, how we can deploy our site developed using the
local visual studio. For deploying the web site, we need to download the
profile information from the newly created Azure web site
Double click on the newly created web site to view the
details of the site
Select the option “Download the publish profile” under the
Publish your app section to download the publishing settings file associated
with the globalmeet web site.
Create a web application using Visual Studio. Right click on
the web application name in Solution Explorer and select the “Publish” option
from the context menu.
This will launch the “Publish Web” window. Import the
downloaded publishing settings using the import button.
Once you import the publishing settings, connection details
will be populated from the settings.
Select Next to move to the Settings page to select the
Select “Next” to preview the deployment items, where we can
select the files required to deploy as part of current deployment.
Now, click on “Publish” button to publish our site into
Third Challenge: Using SQL on Azure
Now, let us create the database for our GlobalMeet
application. We have already defined the simple database schema using the
Entity Framework 5.0.
Open the Azure management portal and select Database option
from the list of options available. Now, select the “New” option to create a
new database. This will display the options available to create a new database.
We can create the database using either “Quick Create”,
“Custom Create” or “Import”.
Select the quick create to create the database quickly by
specifying the database name, select the subscriptions and the server.
Custom create will allow us to create a new database server
along with creation of a new database.
Import option allows us to import a stored database from the
Select the newly created database to view the details
associated with the database.
Select the option “View SQL Database Connection” under the
Connect to your database option to view the database connection string. Copy
the ADO.Net connection string from the listed connection strings.
Now, open the Entity Framework designer to generate the
database. Right click on the ORM designer and choose “Generate Database from
From the Choose your Data Connection wizard, select “New
Connection”. Specify the Server name, user name and password corresponding to
the Azure database; these information will be available as part of the SQL
connection string we obtained from the Azure portal.
Note:- Once you specify the details, you may receive an
error stating “Cannot open server 'xx'requested by the login. Client with IP
address '188.8.131.52' is not allowed to access the server. To enable access, use the SQL Azure Portal or
run sp_set_firewall_rule on the master database to create a firewall rule for
this IP address or address range.” For resolving this issue, open the
management portal, select the database server name and move to the “Configure”
tab. Current system IP will be listed with the option to “Add to the allowed IP
addresses”. Add the current system IP to the list to solve the above issue.
Once the connection is established, system will generate the
DDL statement to create the tables in Azure database.
Click on “Finish” to complete the database generation from
the model. Click on the Execute method to create the tables in Azure database.
Connect to the database using Visual Studio SQL Server
oBject Explorer to verify the created tables
Now, we have the Azure database ready with specified tables.
We can create tables, stored procedures and functions using the Visual Studio
SQL Server object explorer or SQL Server management studio by connecting to the
Fourth Challenge: Virtual Machines
Open the management portal and select Virtual Machines from
the list of available services. Select “New” to create a new virtual machine.
Virtual Machine can be created using either the Quick Create
option or “From Gallery” option.
Quick create option help us to create a virtual machine
Specify an appropriate dns name for the server. Select
specific Operating System image, specify user name and password, and location
to create the virtual machine.
Creation of virtual machine using the From gallery option
provide multiple other configuration options for the user to select.
User can select the OS images from the gallery and also from
the user’s system. After selecting the OS image, user needs to provide the
virtual machine details for configuring the system.
We can see the list of virtual machines created in the
portal under the Virtual machines option.
Connect to VM
Let us connect our newly created virtual machine from our
local system and verify the configurations.
We can perform all VM operations like Connect, Restart, Shut
down and delete using the bottom command line. Select the Connect option from
the command bar to connect to the VM. This will prompt the user to save or open
the rdp file. Save the file to your local system.
Double click on the downloaded rdp and provide the user name
and password specified at the time of VM creation. This will launch the VM just
like any other physical system and we can perform operation on the same.
Creation of VM using the Azure is very easy and fast.
Support for VMs not only enable the developers to scale their product using
multiple VMs, but also help the test environment creation and testing the
application in real environment before hosting it into cloud.
Fifth Challenge: Mobile Access
Our event management system, GlobalMeet is deployed in cloud
and is accessible from anywhere and any device. Following are the few screenshots of the GlobalMeet application in Mobile emulator.
Points of Interest
Integration of LightSwitch HTML5 client Framework with Azure
Better understanding by both LightSwitch developer and Azure professional
Event Management is one of the best candidate for Azure, which require to support varying user load depends on different events.
Highly scalable and high performing web app available globally which can scale from 1 user to 1 million users without any performance impact