I have the honor of speaking at VSLive Orlando from December 12-14th. I get to speak on two topics, which are

Going from Silverlight or WPF to Metro

So you learned Silverlight and WPF, but now Metro is the scene. Fear not! Those XAML and C# skills are extremely useful. Let Greg walk you through some of the changes when moving to Metro/XAML. Come see what additional considerations are needed for creating a Metro application. You know you’re curious to see if you can hit the ground running, so come see if that is indeed the case!

You will learn:
• What the breaking changes are from Silverlight and WPF to Metro/XAML.
• If your previous skills will pay off.
• What additional considerations need to be handled for Metro applications

Using Azure with Windows Phone and Windows 8!

With phones, tablets and other devices exploding in market share, it’s important to know what technologies and tools will help you develop better applications. These devices are often short on processing power and storage, which is where Azure can really help out. Come see what it’s like to use Azure with Windows Phone and Windows 8, including examples with push notifications, storage and authentication for both platforms and a Metro application using the Azure Service Bus.

You will learn:
• How to use Azure notifications with Windows 8 and Windows Phone
• How to use Azure storage with Windows 8 and Windows Phone
• How Metro applications can benefit from the Azure Service Bus

To get all of the information and register, please visit  http://bit.ly/VOSPK17

I hope to see you there!

I have the wonderful opportunity to present 5 sessions at DevLink 2012. If you’re going, I would like to meet up and chat. I will also attend (travel plans permitting) the Windows 8 Developer Camp hosted by Jennifer Marsman the day before. Registration for that event is separate from DevLink and can be found at http://win8devcampchat.eventbrite.com/.

Using Contracts to Integrate with the Windows 8 Experience

Contracts are a new addition with Windows 8 Metro apps that provide a great user experience. For example, users want to Share information in a variety of ways and Windows 8 Metro Contracts allow for that. Come learn about how these Contracts work and how to implement built-in Contracts like Search, Share, PlayTo and Settings.

Using Azure with Windows Phone and Windows 8!

With phones, tablets and other devices exploding in market share, it’s important to know what technologies and tools will help you develop better applications. These devices are often short on processing power and storage, which is where Azure can really help out. Come see what it’s like to use Azure with Windows Phone and Windows 8, including examples with push notifications, storage and authentication for both platforms and a Metro application using the Azure Service Bus.

Parallel Programming in .NET and WinRT

Parallel programming remains a difficult task, but Microsoft keeps making things easier for developers. With the various constructs available, like the addition of the Task Parallel Library in .NET 4, it is important to know what is appropriate for different situations. Devices continue to gain cores and the cloud offers easily distributed computing, so developers should understand how to utilize the environments. Come for a walk-through of how and when to use these constructs, whether that is a mobile device, desktop application or the web. The examples will be C# focused, with JavaScript and F# discussed too.

Node.js, Java, PHP and Python with Azure? Why yes!

New languages and technologies keep finding their way to Azure. Need a Node.js web application? Want to use Eclipse and Java? Have an existing PHP application and want to move it to the cloud? All of these are possible and more! Come see how you can accomplish amazing things with Azure!

How to Ride the Service Bus with Azure

Do you like a loosely coupled architecture? Are you considering a hybrid application between the cloud and on-premise solutions? Are you building mobile applications with notifications and events? The Azure Service Bus can make your life much easier!

Keith Burnell and I will be hosting an Azure and MVC Boot Camp on Friday, June 22nd, 2012 at UW-Fox Valley. You can register at http://azureandmvcbootcamp.eventbrite.com/.

Azure and MVC Boot Camp

Spend a day with some of the nation’s leading web and cloud experts building an ASP.NET MVCweb application that runs in Windows Azure and hosts data in SQL Azure and/or Azure Storage. Together we will build an ASP.NET MVC web application using Razor, jQuery and OData that will be hosted in Windows Azure using several of Azure’s service offerings. We will explore web roles, cloud storage, SQL Azure, and common scenarios. We will show you how to sign up for free time in the cloud and even cover what should not be moved to cloud.

We will save time for open Q&A.

This will be a hands-on event where you will need a laptop configured with the required pieces.

Lunch and prizes will be provided.

ACTION ITEMS PRIOR TO ATTENDING THE EVENT to make the best use of your time at the Windows Azure/ASP.NET MVC Kick Start Event, you must prepare the following requirements before the event:

* WiFi will be accessible on campus, but please download the prerequisites prior to the event.

* Power jacks are available on the top of each desk.

I have been picked to speak at That Conference! The two sessions that I’m lucky enough to present on are below.

Parallel Programming in .NET and WinRT

Parallel programming remains a difficult task, but Microsoft keeps making things easier for developers. With the various constructs available, like the additions of the Task Parallel Library in .NET 4 and async/await in .NET 4.5, it is important to know what is appropriate for different situations. Devices continue to gain cores and the cloud offers easily distributed computing, so developers should understand how to utilize the environments. Come for a walk-through of how and when to use these constructs, whether that is a mobile device, desktop application or the web. The examples will be C# focused, with JavaScript and F# discussed too.

Automation with the Azure Management API

Developers don’t want to repeat tasks! Take out the mundane work of managing the cloud manually and remove the chance for human error. Learn how the Azure Management REST API can be used for automating deployment changes, monitoring your application and more.

I get the pleasure of helping host the Windows Azure Kick Start MSEvent to be held at the Microsoft offices in Waukesha, WI on May 17th, 2012.

Windows Azure Kick Start Milwaukee event

Event locations
Select a city near you

Location Date
Downers Grove, IL May 1
Chicago, IL May 3
Waukesha, WI May 17

FREE Events
Seating is limited,
so register today.

Events run from
9:00AM – 5:00PM

Spend a day with some of the nation’s leading cloud experts in learning how to build a web application that runs in Windows Azure. We will show you how to sign up for free time in the cloud, and how to build a typical web application using the same ASP.NET tools and techniques you already use today. We will explore web roles, cloud storage, SQL Azure, and common scenarios. We will save time for open Q&A, and event cover what should not be moved to cloud. This will be a hands-on event where you will need a laptop configured with the required pieces. We will have help onsite to get the right bits installed as well. Lunch and prizes will be provided.If you can’t join us in person please check out Azure on your own at http://aka.ms/isLP.
Session Requirements

  • A computer or laptop: Operating Systems Supported: Windows 7 (Ultimate, Professional, and Enterprise Editions); Windows Server 2008; Windows Server 2008 R2; Windows Vista (Ultimate, Business, and Enterprise Editions) with either Service Pack 1 or Service Pack 2
  • One click install of Windows Azure SDK and required software using Web Platform Installer.
  • The sample code and handbook for the labs will be provided at the event.
  • Consider bringing a power strip or extension cord.

To register
Select a city near you or to register by phone, call 1-877-MSEVENT.  .  If you can’t attend please visit http://aka.ms/isLP.

 

I am speaking at the MSEvent – Windows Developer Event to be held at Navy Pier in Chicago, IL. Here is some more information. I hope to see you there! Register here Windows 8 Developer Event.

Windows 8 Developer Event in Chicago
Date April 26, 2012
Time 9:00AM – 5:00PM
Location

Navy Pier
600 East Grand Avenue

Chicago, IL

FREE Event

Seating is limited,
so register today.

   

Windows reimagined.Learn everything you need to start building Metro-style apps for Windows today at our free, full-dayWindows Developer Event.We’ll show you how to use Visual Studio to code fast, fluid, immersive and beautiful Metro-style applications in HTML5/JavaScript, XAML/C# and C/C++.

Your investments in these languages carry forward, making Windows a no-compromise platform for developers.Whatever language you choose, your app gets deep integration with the Windows shell, including notifications, live tiles, deep links, and contracts with other apps. And now you can build once and support all Windows customers, no matter what type of PC they have—from tablets to laptops to convertibles to desktops.Seating is limited and registration is not guaranteed. Secure your spot today!Notes

This free event is brought to you by Microsoft. However, you are responsible for booking and funding your own travel and accommodations. Please notethat there is limited space available for this event, so be sure to register early.

 

I will be speaking the weekend of April 14th and 15th in Minneapolis at the Twin Cities Code Camp! The information about my session is below. If you’re interested in attending, please register now using EventBrite. For more event information, please go to the TCCC website. I hope to see you there.

Parallel Programming in .NET and Azure – Greg Levenhagen

Parallel programming remains a difficult task, but the .NET framework keeps making things easier for developers. With the various constructs available, like the addition of the Task Parallel Library in .NET 4, it is important to know what is appropriate for different situations. Devices continue to gain cores and the cloud offers easily distributed computing, so developers should understand how to utilize the environments. Come for a walk-through of how and when to use these constructs, whether that is in the cloud, a mobile device, desktop application or the web.

Deploying applications to Azure requires a change in the way of thinking about configuration. When roles can be spun-up at any time, the configuration settings will be what the deployment package contains. This means changing configuration within a role will most likely lose those changes when Azure moves a role, a role crashes or you add another role. The key is to make sure that the deployment package is up to date. By using the abstracts below, a developer can write code that works inside and outside of Azure.

A Windows Azure project contains configuration files for each environment called ServiceConfiguration.*.cscfg. You can create more than the default provided, which are Local and Cloud. Keeping the Azure Storage connection string and other settings in these files allows for greater portability.

By setting the CloudStorageAccount‘s publisher, the developer can read configuration values differently than strictly using ConfigurationManager. Under a Role’s project properties, browse to the Settings tab. For this example, you’ll want to click “Add Setting” and specify the details for Name and Type as below. The DataConnection setting will be used to store the connection string for Azure Storage.

For the Value, notice the ellipse button. It will provide a popup with the following.

When using the storage emulator, the Value will be set to “UseDevelopmentStorage=true”. The focus of this post is leave the configuration management in these settings as much as possible. This helps to allow the code to remain unchanged when moving between environments. There is a Service Configuration dropdown on the Settings tab that should be changed and the appropriate values specified for each scenario. For example, specify use of development storage for Local and specify the account credentials for Cloud.

Please note that the code shown below can be refactored to live in different places. It doesn’t have to be put into the global.asax or in each Controller for MVC projects. Using WebActivator, base classes and helper classes are worth considering.

Setting the configuration publisher within the Application_Start method in the global.asax file is the first action to take.

		protected void Application_Start()
		{
			AreaRegistration.RegisterAllAreas();

			RegisterGlobalFilters(GlobalFilters.Filters);
			RegisterRoutes(RouteTable.Routes);

			BundleTable.Bundles.RegisterTemplateBundles();

			CloudStorageAccount.SetConfigurationSettingPublisher(
				(configurationName, configurationSettingPublisher) =>
					configurationSettingPublisher(RoleEnvironment.GetConfigurationSettingValue(configurationName)));
		}

As the code self documents, the SetConfigurationSettingPublisher method takes a lambda expression as an argument. The configurationName variable is of type string and the configurationSettingPublisher variable is of type System.Func<string, bool>.

In case you don’t have a tool to automatically import using statements, the following are required.

	using Microsoft.WindowsAzure;
	using Microsoft.WindowsAzure.ServiceRuntime;

Before moving on, I want to point out that I’m using a static constants class to keep hard-coded strings in one place. This hard-coded string bridges the gap between code and the settings, but the value is what we are concerned about changing.

	public static class ConfigurationConstants
	{
		public const string DataConnection = @"DataConnection";
	}

Now that the wiring up of the Storage configuration is done, we need to consume it. For this example, let us use a Controller class from an ASP.NET MVC4 project that is specified as a WebRole. A few steps are needed to get access to the TableServiceContext.

	using System.Web.Mvc;

	using Microsoft.WindowsAzure;
	using Microsoft.WindowsAzure.ServiceRuntime;
	using Microsoft.WindowsAzure.StorageClient;

	public class HomeController : Controller
	{
		private readonly CloudStorageAccount cloudStorageAccount;
		private readonly CloudTableClient cloudTableClient;
		private readonly TableServiceContext tableServiceContext;

		public HomeController()
		{
			this.cloudStorageAccount = CloudStorageAccount.FromConfigurationSetting(ConfigurationConstants.DataConnection);

			this.cloudTableClient = new CloudTableClient(this.cloudStorageAccount.TableEndpoint.AbsoluteUri, this.cloudStorageAccount.Credentials);

			this.tableServiceContext = this.cloudTableClient.GetDataServiceContext();

			string someOtherSetting = RoleEnvironment.GetConfigurationSettingValue(ConfigurationConstants.SomeOtherSetting);
		}
	}

Inside the constructor, the first statement is retrieving the configuration setting for the data connection. This allows changing the setting from the project level based on the service configuration (Debug, Cloud, etc.) and not having to change any code when switching environments. If the CloudStorageAccount.DevelopmentStorageAccount option is used instead of the FromConfigurationSetting method, it is essentially using a hard-coded value.

The second statement is creating a CloudTableClient, which can be replaced with a CloudQueueClient or CloudBlobClient. The constructor for the CloudTableClient is taking in a Uri and a StorageCredentials as arguments. By using the overload for the Uri and using an AbsoluteUri for the value, it avoids complications with changing Endpoints (Http, Https, TCP).

From here, the third statement is simply gaining access to the TableServiceClient. The last statement is showing how to read a setting that isn’t going through the CloudStorageAccount.

You’ll most likely want to have your table name(s) specified in configuration or use whatever mechanism works for your business case. Also, don’t forget to properly check if the table exists before using it. There are methods on the CloudTableClient for doing that type of management.

We all want to avoid hard-coding, so whatever approach you take make sure it’s not going to limit you or cause problems later in the application’s life.

Requirements often dictate that storage and/or processing be done in a specific geographical location. I often get asked, “Does Azure have geo-location specific support?”  Most of those questions originate from the need for compliance that is either from industry or government. Azure allows specification of geographical regions or affinity groups. Geographical regions are related to the data centers, like North Central US, South Central US, Anywhere US, East Asia, North Europe, and so on. The list of options will grow as more data centers are added.

When creating a New Hosted Service account in Azure, the following options are provided. This post is bringing light to the choices under the Choose a region or affinity group.

Instead of selecting a region, it is possible to specify an affinity group. Affinity groups are hints to Azure that essentially state that everything within the group should be as close in proximity as Azure will allow. That usually means keeping items within the same data center, which besides having the benefit of geo-location, can sometimes offer performance improvements for communication.

The drop down for affinity groups allows for selection of existing groups or creation of a new one.

When creating a new affinity group, it allows for specification of a region just like what was shown previously.

The previous screenshots are for a New Hosted Service, so here is what it looks like for creating a Storage account in a similar fashion. The current choices for Regions when creating an Azure Storage account are shown.

In the case for choosing an affinity group, notice the existing group created by the hosting account. By selecting the same group, Azure will keep the two accounts close in proximity.

These features offer great control of where the processing and storage take place within the Azure ecosystem. When there are concerns about governmental, political and compliance requirements, Azure has some nice answers!