Tuesday, April 12, 2011

HelloWorld


After last 3 weeks environment related settings, we are ready to make our hands dirty on creating Azure code. Isn’t it cool !!!

Since 1987 of my higher secondary computer lesson (proud to be earlier computer students in India), we used to learn the computer language using the famous ‘Hello World’ program right from quick basic, fortran, cobol, pascal, lisp, c, c++, vc++, java, c#, etc. Same old coding formulae/masala!

After the proper installations of VS2010, AzureSDK, IIS, etc. the hello azure application is created in few seconds with the built-in wizard navigation. Quite simple steps to create the first azure application with the above set up:


  1. Launch Visual Studio 2010 as administrator.

  2. Click File New Project, from the Visual C# installed Cloud templates.

  3. Create Windows Azure Project with the solution name ‘HelloAzure’.

  4. Thatz it; just click OK to launch a wizard.

  5. From the wizard, add the ASP.NET Web Role in C# with ‘HelloAzure_WebRole’.

  6. Run it (Ctrl+F5) and got the output ‘Hello Azure Application’.


Next week, I’ll talk about the interesting topic on Emulators in Azure development platform. Now, letz have a deep dive in the auto generated code piece (in the snap shot). Itz a simple web role (web application) and so 2 projects within the solution namely HelloAzure_WebRole and HelloAzure.

The first project HelloAzure_Webrole is quite simple like other ASP .NET application, comprises of site.master, global.asax, web.config, App_Data, Default.aspx, etc. One new entity is ‘WebRole.cs’ which is the entry point for Azure web role app as public class WebRole : RoleEntryPoint HelloAzure project is new concept. It contains three major components. A) HelloAzure_WebRole configuration, b) ServiceDefinition.csdef and c) ServiceConfiguration.cscfg They are the discussion points for next blog entry. Until then, happy cloud coding!

Sunday, April 3, 2011

aspnet_regiis


After IIS setup, machine throws an error 0xc0000005. Haa, herez the solution.. aspnet_regiis tool.

If you install the .NET Framework on a system that has IIS already installed, IIS is automatically configured to handle requests to ASP.NET pages, and to redirect the execution to the ASP.NET runtime. However, it may happen that you installed the framework on a Windows system where IIS was not already present, and just later decided to add IIS. Registering ASP.NET on IIS is not just a matter of associating the various .aspx, .asmx, .axd, .ashx and the other ASP.NET extensions to the aspnet_isapi.dll ISAPI, more has to be done to create the ASP.NET account and to set it for ASP.NET requests, register the ISAPI itself and other stuff. Doing all this manually can be a difficult operation, and requires a good understanding of many details. Fortunately there is an utility, shipped with the .NET Framework but not documented, that can take care of these configuration chores for you. The utility is aspnet_regiis.exe, it is located under %WindowsDir%\Microsoft.NET\Framework\vx.y.zzzz\ and you should call it with the -i parameter: aspnet_regiis.exe -i

The installation of .NET Framework and registration of the Framework in ISS needs some steps like script mapping: assotiation of different .NET specitical extensions. The installation can run without the step (switch -ir), but it has more sense to skip the steps only if a previous version of ASP.NET is already registered with IIS. Exactly this do aspnet_regiis.exe -iru. If no previous version of ASP.NET is registered with IIS, then aspnet_regiis.exe -iru do make all registrations in IIS and work like aspnet_regiis.exe -i. If do a previous version of ASP.NET is already registered in IS the aspnet_regiis.exe -iru work like aspnet_regiis.exe -ir. The usage of the -u parameter "uninstalls the version of ASP.NET that is associated with the ASP.NET IIS Registration tool from the computer. Existing script maps to this version of the ASP.NET ISAPI are automatically remapped to the most recent remaining ASP.NET ISAPI version installed."

Sunday, March 27, 2011

Web server setup


IIS 7 is the Web server used in Windows 7. IIS 7 has a completely modular setup design that enables control over the footprint of a Web server. IIS can be easily configured via Start->Control Panel->Programs ->Programs and Features ->Turn Windows features on or off.

Next important step is to understand the significance of each IIS option. It helps us to configure IIS for Azure development platform.

FTP Publishing Service: Installs File Transfer Protocol (FTP) Service and FTP management console. Provides support for upload and download of files.

Web Server Management Tools: Installs Web server management console and tools. It contains IIS Management Console, IIS Management scripts Tools and Management Service

Application Development Features: Installs support for application development such as ASP.NET, Classic ASP, CGI, and ISAPI extensions.

Common HTTP Features: Installs support for static Web server content such as HTML & image files, custom errors, and redirection.

Health & Diagnostics: Enables you to monitor and manage server, site, and application health such as HTTP Logging, Request Monitor, Tracing, etc.

Performance Features: Static Content Compression and Dynamic Content Compression before returning it to a client.

Security: Enables additional security protocols to secure servers, sites, applications, vdirs, and files such as Windows Authentication, Client Certificate Mapping Authentication, etc.

For cloud app development, I enabled Web Management Tools->IIS Management Console and all Application Development & Common HTTP Features. Apart from these, Request Filtering and Windows Authentication of Security + Static Content Compression of Performance Features. My dev box setup is attached as the snapnshot.

Sunday, March 20, 2011

Local software installations


Last week blog, I was talking about free trial version of extra small instance, supplied by Microsoft Azure team. To start the journey, desktop is loaded with Windows 7 OS (Ultimate version) with 32 bit processing mode. Hardware spec contains Intel i3 processor, 4 GB RAM and 500 GB disk drives.

Once the desktop and OS is ready, next question is ‘where did azure get started?’ As far as azure software application development is concerned, Microsoft supports various languages like Java, Python, PHP, .NET, etc. I’ve little knowledge in .NET when compared to others and so installed Visual Studio 2010 IDE (Integrated Development Environment) targeting C# code. Visual Studio 2010 is the first software installation step.

Next major step is to install Tools and SDK. SDK stands for Software Development Kit. To develop Azure application, we need to install Azure SDK, supplied by Microsoft Azure team. Itz freely download able at azure download page. Installation is pretty simple wizard to run thro.

After Azure SDK, we need to install the tools for Visual Studio 2010. Itz also pretty straight forward to install. Logically, thatz it. Set and ready to launch!

Logically; but reality itz a big boom. What happened? I got few interesting error not to allow the installation steps. Why? Few pre requisite were missing. Whatz that?

After VS2010 installation, first enable IIS 7.0 with ASP .NET settings. As the second step, we need to do the proper SDK installation based on the local system either 32 bit SDK (x86) or 64 bit SDK (x64). Third step is to install the hotfixes for VisualStudio (KB983301) and Windows (KB981002) based on the underlying OS bits (x86 or x64). Fourth step is setup the next generation identity framework Windows Identity Framework(WIF), which enables identity and access management solution built on Active Directory (AD). Fifth step is to install ApplicationFabric SDK, which comprises of access control and service bus.
After the above vital 5 steps, Windows Azure tools for Visual Studio installs successfully and the development environment is ready to launch!

Saturday, March 12, 2011

Web coding threat


Cloud computing is based on the Internet landscape. The threats within the Internet may be growing, but our ability to write efficient web secured code provides a significant advantage to the end users.

Microsoft pattern and practices talks about improving web application security: Threats and Countermeasures gives you a solid foundation for designing, building, and configuring secure ASP.NET Web applications. Whether you have existing applications or are building new ones, you can apply the guidance to help you make sure that your Web applications are hack-resilient. Itz published at http://msdn.microsoft.com/en-us/library/ff649874.aspx


It shows you how to review code built using the .NET Framework for potential security vulnerabilities. It shows you the specific review questions to ask and discusses the tools that you should use. In addition to general coding considerations, it contains review questions to help you review your applications for cross-site scripting, SQL injection and buffer overflow vulnerabilities

Code reviews should be a regular part of your development process. Security code reviews focus on identifying insecure coding techniques and vulnerability that could lead to security issues. The review goal is to identify as many potential security vulnerability as possible before the code is deployed. The cost and effort of fixing security flaws at development time is far less than fixing them later in the product deployment cycle.

Saturday, March 5, 2011

Cloud Essentials


Few of my blog followers, motivated me to shift the gear from .NET Framework internals to the latest topic. Hmmm.

I had little aspiration to make my hands dirty on Azure platform.Coincidentally, Microsoft launched a new deal for the free Windows Azure Platform Trial till June 30th, 2011. This developer motivating deal comprises the listed benefits.
Compute: 750 hours of an Extra Small Compute Instance, 25 hours of a Small Instance
Storage: 500MB, 10k Storage transactions
Data Transfers: 500MB in / 500MB out
Relational Database: 1G Web Edition SQLAzure database (for 90 days only)
Access Control transactions: 100k
Service Bus connections: 2

Additional drives are thro industry news like Azure has 31K customers. Information week quotes an article that Microsoft's Azure cloud data center outside Chicago was able to execute the required steps in 10.142 seconds. It named Azure as the faster cloud service on comparison of 13 vendors ('http://www.informationweek.com/news/cloud-computing/infrastructure/showArticle.jhtml?articleID=229300184&cid=RSSfeed_IWK_News')

With all the above drivers, letz kick start this series. Any cloud component either hardware or software, contains 5 essential characteristics
1. On Demand self service
Without interacting the service provider, the customer should be able to add/delete the required resources on few clicks.
2. Broad Network access
Serviced resources are executed via wire/internet; not as client based usage.
3. Rapid Elasticity
Rapidly scaling is facilitated to meet the customer demand within a verylittle time frame.
4. Resource Pooling
Shared usage at multi tenant policy like car pool
5. Measured service
Metered charges based on the usage by the customer need.

Cloud computing provides 3 service models. They are (a) SaaS(Software as a Service) (b) PaaS (Platform as a Service) (c) IaaS (Infra as a Service). They adhere to the above listed 5 essential characteristics.

On lighter side, home R&D environment is getting launched and ready for Azure (Microsoft Cloud) coding!

Saturday, February 26, 2011

CTS Spec


Types expose functionality to your applications and other types. Types are the mechanism by which code written in one programming language can talk to code written in a different programming language.

Because types are at the root of the CLR, Microsoft created a formal specification—the Common Type System (CTS)—that describes how types are defined and how they behave.

The CTS specification states that a type can contain zero or more members.
  • Field A data variable that is part of the object’s state. Fields are identified by their name and type.
  • Method A function that performs an operation on the object, often changing the object’s state. Methods have a name, a signature, and modifiers. The signature specifies the number of parameters (and their sequence), the types of the parameters, whether a value is returned by the method, and if so, the type of the value returned by the method.
  • Property To the caller, this member looks like a field. But to the type implementer, it looks like a method (or two). Properties allow an implementer to validate input parameters and object state before accessing the value and/or calculating a value only when necessary. They also allow a user of the type to have simplified syntax. Finally, properties allow you to create read-only or write-only “fields."
  • Event An event allows a notification mechanism between an object and other interested objects. For example, a button could offer an event that notifies other objects when the button is clicked.