Cloud Computing is a magic term which is mostly heard in the recent past among the technical world Devs. For those who never knew what is a cloud (in technical terms), let me put a simple description – Cloud saying to a Dev “You build the app, and I will take care of production environment”, its as simple as that. Even Microsoft don’t want to let their proportion of coders go down, it immediately came up with Windows Azure, Microsoft Cloud Platform. Windows Azure consists of mainly three important parts – Windows Azure (a place to manage the hosted services), SQL Azure ( to manage the data storage to DB) and AppFabric (used to build, scale and manage Web). Essentially a dev need to get accustom with all these three parts sooner or later.
I got my first interaction with cloud, say a month ago. I found this part of the technology most fascinating and interesting. So I started my work to learn this technology, and also want to share my knowledge with my folks at intstrings. I will get back to you guys with more details on how cloud works in my next article. For this time, my main concentration in on getting started with this technology and to play around with some of its cool features.
So lets get started…welcome to Cloud.
Before we get started, we got to know the prerequisite to this platform – Azure Account. Microsoft came up with different plans for different sections of audience. For more details, http://www.microsoft.com/windowsazure/offers/default.aspx. So make sure you already got an account, may be a Introductory account, where you can play with cloud for free*.
*Conditions apply
. If you in the limitations of the offer, its free. Or else, Don’t ask me
.
================================================================================================
STEP # 1 – Create your first cloud compatible Web App
================================================================================================
1) Open Visual Studio 2010 –> File –> New –> Project.
2) Select ‘Cloud’ under Visual C# –> Select ‘Windows Azure Project’ in the middle pane –> Give name ‘MyFirstAzureApp’ (as shown in fig).

NOTE :-
- For first the first time users, Visual Studio 2010 notifies to download Azure Tools by showing “Enable Windows Azure Tools” instead of “Windows Azure Project”. Select and Click Ok.
- To install the Windows Azure Tools, you must have Internet Information Services 7.0 and the ASP.NET Application Development components installed. If these components are not installed, Windows Azure Tools Setup will prompt you to install them.
- Click Download Windows Azure Tools.
- On the download page, download the Windows Azure Tools according to the instructions.
- Then follow the above mentioned procedure to create first Azure App.
3) Click Ok.

4) Visual Studio Prompts you to select which type of Roles you want to include in the Axure Project. Select ‘ASP.NET Web Role’. Click on the ‘>’ button, so that the selected role will be added to the solution.
5) Rename the Role, by hovering the mouse on top of the selected row in the right pane.
6) You can add multiple roles here itself. But for this demo we are going to use only one role.
7) Click Ok.
Complete solution which is created is as follows –

================================================================================================
STEP # 2 – Compile and Run
================================================================================================
NOTE – This is an option step. You can skip this (if you want).
1) To Debug –> Press F6. Visual Studio notifies ‘Build Succeeded.
2) To run –> Press F5. Visual Studio performs some set of operations on the back end, like packaging and starting ‘Windows Azure Emulator’ , which can be used to monitor Azure Applications (see below fig).

3) Finally if everything goes as per expectations, Visual Studio launches a browser, which displays our Web Role (as shown in fog below).

4) Now lets see what is an Emulator – Right click the Compute Emulator is the System Tray and select ‘Show compute Emulator UI’ and ‘Show Storage Emulator UI’. Which are as shown below –


As I already mentioned, Emulators are used to check the status of the Azure App. Compute Emulator is used the condition of the Hosted Service i.e., in this case Web Role. And Storage emulator is used to get the status of the Storage options of the Azure Application. And these emulators are also used mainly to test and debug the Azure app. A more detailed analysis on the Emulators will be followed in my upcoming articles.
So once we made sure that our app is running successfully in out local machine. We can configure it and deploy to the Azure Platform.
================================================================================================
STEP # 3 – Configure Azure App
================================================================================================
A simple configuration to get started with is to change the number of instances of your app running in the cloud.
1) Right Click the ‘MyWebRole’ under the Roles folder of MyfirstAzureApp project. Select Properties.

Change the instances count for 1 to 2. Its always better to have more than 1 instance running on the cloud, even Microsoft recommends it based on the point that if one instance is failed, the other will be scaled accordingly and there will not be any break in the service to the client.
Once the configuration is completed, Right Click ‘MyfirstAzureApp’ project in the Solution explorer and select Publish. A window pops up asking for which type of publish is required (as shown below).

Select ‘Create Service Package Only’ option from the popup and click Ok. A Package file and a configuration file is created.
================================================================================================
STEP # 4 – Upload to Azure Platform
================================================================================================
Follow the below procedure to upload the Azure project to the Microsoft Azure Platform.
1) Open windows.azure.com, Login with the credentials. See the Prerequisite mentioned at the starting of the tutorial.
2) Click on the ‘New Hosted Service’ option on the top of the windows.azure.com (after successful login).

*For Security purpose, I blurred the actual details of my account.
3) Enter the following details –
- Enter a name for your service :- AzureTestService1
- Enter a URL prefix for your service :- AzureTestDeploy
- Choose a region :- Anywhere US
- Deployment Options :- Do not Deply
4) Click OK on the bottom of the popup page.
This creates a new hosted service in your Azure Account, which can be used to deploy our app.
now lets go back to Visual Studio. Right click the ‘MyFirstAzureApp’ project in the Solution explorer and select Publish. This time from the popup window select ‘Deploy your windows Azure propject ot Windows Azure’ option.
1) Select Credentials Dropdown, Click ‘<Add>’.
2) A Management authentication Window will be opened, Click on the ‘Create Certificate for Authentication’ dropdown and select ‘New’. Give a Friendly name – ‘MyFirstAzureAppCert’ and click OK.

3) Click on the ‘Copy the Full Path’ and go to windows.azure.com. Under ‘Hosted Services, Storage Account and CDN’ tab, select Management Certificates section. Click on ‘Add Certificate’ on top of the page.

Select Browse, paste the copied full path of the certificate and finally add the certificate as shown in above fig. Click Done.
4) Now, select the Subscription ID from the User Management Tab. Go back to Visual Studio for Management Authentication Window. Paste the Subscription ID in the Subscription field.
5) Finally give a appropriate name to the Credentials – "’MyFirstAzureAppCreds’.

***I already created a storage account for my initial projects, that is what it is listed in the Storage Account field. But for current app there is no need for us to create a storage account, as we are not dealing with data transactions.
Click Ok. Publishing to the Windows Azure Platform is started. Status of the Deployment will be notified in the Activity log (as shown in fig).

Once the deployment is complete –

That’s it. We hosted out first Azure Project in the cloud. Now we can test it –
Copy the Website URL from the Activity log – http://bff815ca99c24560a5b23c265de88fc5.cloudapp.net/ and run it from browser.

In this tutorial – we have seen, how to create a Microsoft cloud compatible Project, Compile it and finally deploy it on the cloud.
This is the first and basic tutorial on the Windows Azure Development. In future I will come up with much more detailed and advanced concepts in Windows Azure.
Till then, Fly in the Cloud
.







Hi
Really it was a great help in understanding the Deployment with Azure. Thanks so much for the systematic explaining in the document.
I have one issue, not understanding why it happens after continuing with deployment.
We have our Windows Azure platform account. And the access to the Azure developer portals Windows Azure ,Microsoft SQL Azure and AppFabric
I have created a Windows Azure Project, successfully created a service package.
While Attempted to deploy the Windows Azure Project to Windows Azure with proper certificate, subscription id etc… (With no storage account as this is a very simple application and we are not as we are not dealing with data transactions), when I proceed for OK, I get the message “Completing the operation you requested… and no activity happens even after hours ….
FYI: The development environment is in India, and while Adding Certificate in https://windows.azure.com/ I have chosen Region “Anywhere US”.
Pls suggest, if there is any issue due to the Region selected or some other issue
Regards,
Pravin.
Try by deploying using Visual Studio…to my knowledge there are some of these kind of problems persist in the Azure system.
Thanks.
Really Great.. Thank you very much.. i need more knowledge sharing for u. can u done before send sms to mobile asyn using windows service if you have reply me..
No, I Never, you may try google for more answers. You need a SMS gateway for the same.
Really!! Very nice article, you have elaborate very well about Installing and Creating Windows Azure Application in Visual Studio 2010. It helped me lot, you made it very simple and understandable. Thanks for sharing with us. Some other articles too explained very well about Windows Azure development which I was found during searching time, The posts URL are…..
http://www.codeproject.com/Articles/83481/Windows-Azure-Storage
http://www.mindstick.com/Articles/2575d64f-2466-4f6e-98b0-224c59796c5f/?Install%20and%20Create%20a%20Windows%20Azure%20Application%20in%20VS%202010
I would like to say thanks to everyone for yours precious post.