Essential Guide

An enterprise guide to Microsoft Azure cloud

A comprehensive collection of articles, videos and more, hand-picked by our editors

Managing Azure development with more than just native tools

Sound development practices may not change much across platforms, but with Windows Azure, there are a few tricks to the trade.

In many ways, sound development practices are common across programming languages, platforms and application areas -- but there are techniques that can be more useful in some cases than others. Developing for the cloud is one such case.

When building applications for Microsoft's Windows Azure in particular, it can help to keep in mind three points: use tools designed for the platform, design for distributed processing and plan for performance.

When building applications for Microsoft's Windows Azure in particular, it can help to keep in mind three points: use tools designed for the platform, design for distributed processing and plan for performance.

Using Windows Azure-specific tools

It is not surprising that Microsoft's flagship dev tool, Visual Studio, has a set of tools for Windows Azure development. You can install Windows Azure Tools from within Visual Studio; the exact steps can vary by version. When you create a new project, you will be able to select a Windows Azure Project and add Web and worker roles to your project. Web roles are designed to run instances of Microsoft IIS; worker roles are Windows virtual machines with Microsoft IIS disabled. Once you have your roles created, you can add application-specific code.

Visual Studio allows you to set service configuration parameters, such as instance count, virtual machine size, whether to use HTTP or HTTPS and diagnostic reporting levels. Typically, when starting out, it helps to debug application code locally. Running your application locally will likely require different configuration settings than when you run it in Windows Azure, but Visual Studio allows for multiple configuration files. You will just need to select the appropriate one for each environment.

The toolkit includes the Windows Azure Compute Emulator, which supports viewing diagnostic logs and storage emulation.

Windows Azure Tools would not be complete without a feature that streamlined the process of publishing your application to the cloud. The publication feature allows you to specify a configuration and environments (e.g., Production) as well as some advanced features, such as enabling profiling and IntelliTrace -- a debugging tool that collects detailed event information about a program's execution and allows developers to view changes in the state of the program over the course of execution.

Designing for distributed processing

Visual Studio tools for Windows Azure help when it comes to developing and deploying code. Prior to that, it helps to keep in mind some points about designing that code for a cloud environment, and in particular designing for a distributed environment. The following tips can help prevent potential problems that could lead to poor performance and protracted debugging and runtime analysis.

A fundamental principal of distributed application design for the cloud (and other Web applications) is to not store state information in the Web server. Keeping your application stateless relative to the Web server tier enables more scalable applications. You can deploy a load balancer in front of a variable number of servers without disrupting the running of the application. This is especially important if you plan to take advantage of Windows Azure features for changing the number of servers deployed. This configuration also helps with patching. One server can be patched at a time while others continue to run, maintaining the availability of your application.

Even in distributed applications there may be bottlenecks that can adversely affect performance. For example, multiple instances of your application can make simultaneous queries to a database. If the calls are made synchronously, it is possible to consume all available threads in a server. Both C# and VB support asynchronous calls that can help mitigate the risk of blocking resources.

Planning for optimal performance

A key to maintaining adequate performance in the cloud is to design for scaling out the number of servers you run and partitioning your data and workload. Design features, like stateless sessions, help allow for partitioning and scaling out. Avoiding -- or at least minimizing -- global data structures that are used across multiple workloads can reduce the risk of bottlenecks in your workflows.

If you are migrating an SQL server application to Windows Azure, you should assess how to best take advantage of the cloud's different storage types. For example, it may have made sense to store blog data structures in your SQL server database, but in the Windows Azure cloud, blob storage could reduce storage costs without requiring significant changes to your code. If you are working with highly denormalized data models and not taking advantage of SQL server's relational operations (e.g., joins and filtering), then table storage may be a more economical option for your application.

About the author:
Dan Sullivan holds a Master of Science degree and is an author, systems architect and consultant with more than 20 years of IT experience. He has had engagements in advanced analytics, systems architecture, database design, enterprise security and business intelligence. He has worked in a broad range of industries, including financial services, manufacturing, pharmaceuticals, software development, government, retail and education. Dan has written extensively about topics that range from data warehousing, cloud computing and advanced analytics to security management, collaboration and text mining.

This was first published in April 2014



Enjoy the benefits of Pro+ membership, learn more and join.

Essential Guide

An enterprise guide to Microsoft Azure cloud



Forgot Password?

No problem! Submit your e-mail address below. We'll send you an email containing your password.

Your password has been sent to: