Friday, March 11, 2011

Understanding Diagnostics in Windows Azure

 

Windows Azure diagnostics provides facility to store diagnostics data. Azure diagnostics supports logging and monitoring of diagnostics data. It uses blob service or table service to save diagnostics data, depending on the diagnostics data. Before logs are saved in a container they are indexed in WADDirectoriesTable table in the storage account.
Following diagnostics data is stored in table storage:
Data Source Table name in Azure Storage Detail
Windows Azure Logs WADLogsTable These are the application logs dumped from the application.
Windows Azure Diagnostics Infrastructure Logs WADDiagnosticInfrastructureLogsTable These are the logs about running of diagnostics service.
Windows Event logs WADWindowsEventLogsTable These are the logs generated on the instance where logs are running.
Performance counters WADPerformanceCountersTable These are the performance matrices like memory utilization, processor utilization, response time etc.
Following diagnostics data is stored in blob storage:
Data Source Container name in azure storage Detail
IIS Logs wad-iis-logfiles These are the IIS logs generated by role instances.
Failed Request Logs wad-iis-failedreqlogfiles These are the IIS failed requests logs generated by role instances.
Crash Dumps wad-crash-dumps These are the logs generated on the application crash.

Wednesday, March 9, 2011

Deploying an application in Windows Azure

In the previous article we have seen how to create a Hello World application in azure. In this article we will see how to deploy it in Windows azure. To deploy an application in azure, two files are needed- a package file and a configuration file. Configuration file is already in CloudService1 named ServiceConfiguration.cscfg. Now for the package file just right click on the CloudService project and click Publish.
clip_image002
Then it asks to create just a package file or to deploy it in azure.
clip_image004
If first option is selected then it creates the package file and opens the explorer.
clip_image006
Once we have a package file (.cspkg) and configuration file (.cscfg) then we can deploy it through management portal, or azure service management cmdlets, or Cerebrata’s CloudStorageStudio, or Cerebrata’s Azure management cmdlets. We can directly upload it through visual studio also, if we select second option from publish dialog. It needs a subscriptionId and a X509 v3 certificate as shown below:
clip_image008
Then we have to provide deployment environment and storage account.
Whichever option we had selected, we need:
a) A Windows Azure Subscription – when we sign up for azure, a subscription is associated with our live Id.
b) A Windows Azure Hosted Service – we need to create a hosted service for deployment. It provides two deployment environment- production and staging.
c) A Windows Azure storage account – When we deploy through visual studio then package file is first uploaded in blob storage of the storage account, and then deployed from the blob service.
So summarizing deployment through management portal in some simple steps:
1) We need a package file and a configuration file to deploy.
2) To create a package file click publish and create package only option from project.
3) Sign In the management portal.
4) Create a new hosted Service if you want to deploy in a new service.
5) Then in deployment environment either deploy in production or staging.
6) Then start the deployment.
7) You can see the progress of the deployment on the portal
8) To delete a deployment first click on stop, and when it is stopped delete it.

Tuesday, March 1, 2011

Creating a “Hello world” application in Azure

In this article we will see how to create a “Hello World!!!” application in azure in .net. I had used Visual Studio 2010 along with azure SDK 1.3 installed. Start visual studio and select a new project. In the cloud template select Windows Azure Cloud Service.
clip_image002
Once you click OK. It asks for selecting a Role. Here we are adding an ASP.Net Web role.
clip_image004
It will create two projects- CloudService1 (Azure Service Project) and WebRole1 (ASP.net Project). The Azure service project is used to configure the application, and to create a deployment package. ASP.Net project is like a normal web project.
clip_image006
Here I removed header div from the SiteMaster.
clip_image008
And add a text “Hello World!!!!” in the default.aspx
clip_image010
And we are done. Now Select Cloud Service as your startup project and run it. When you run it, azure simulation environment is initialized, and it starts development storage and development fabric.
clip_image012
And here you can see your Hello World!!!
clip_image014
If you select WebRole1 as your startup project and run the solution. It will run as a normal ASP.Net project and hosted locally on localhost.
If you click on the Azure Simulation and select “Show development Fabric UI” then it will show the azure services running on your machine.
clip_image016
Here My CloudService1 is running having a single instance of WebRole.
clip_image018