BizTalk 2010: BizTalk Feature Pack Released

Hi Folks I wanted to let you know about some new BizTalk details with the release
of a Feature pack.

The main component of the Feature Pack is to install a new component called ’BizTalk
Server 2010 AppFabric Connect for Services’
– which in essence provides cloud
based endpoints for your BizTalk deployments (based on .NET services)

Download from HERE

I’m rolling my up my sleeves and looking further into it.

(There’s an MSDN blog post on it – http://blogs.msdn.com/b/biztalk_server_team_blog/archive/2010/10/21/biztalk-server-appfabric-connect-for-services.aspx of
which 2 screen shots below are taken from it)

Which gives you Azure/.NET Service Bus WCF bindings seen from within BizTalk of the
following:

I haven’t been able to see Queuing support from within the Binding,
previously this was custom code that was written when establishing a connection to
the .Net Service Bus.
(this gives you the ability to publish msgs out to the ’bus’ and clients can be either
connected or disconnected and when they reconnect, the msgs will flow from their last
one.)

Interesting times,

Mick.

StreamInsight: Understanding dynamic query composition

Been tied up with PASS for the past (pun intended) couple of weeks, so it’s time to get a bit caught up on writing.  One of the key technical features of StreamInsight is the ability for one query to consume the output of another, enabling the system to avoid having to process events twice, and opening up a new world of flexibility.  The feature that unlocks these capabilities is Dynamic Query Composition.  That being said, some of the nuances of how StreamInsight constructs queries and flows events is not always obvious.  As this has resulted in me making a few sub-optimal design choices in the past , I figured I’d put together a little article demonstrating the subtle nuances involved when using (or not using) DQC.

For more background on DQC, please refer to:

Take the diagram below, illustrating a common query composition pattern.  Given a single input stream (represented by the inputAdapter shape in the diagram), we would like to consume the stream of events from that adapter in both queryOne and queryTwo.

At first glance, this query syntax would seem to fit the bill (note that I’m using the new IObservable support for the input adapter, but using the classic adapter syntax to create the queries bound to an output adapter, to explicitly show query creation):

Code Snippet
  1. // Convert the data source into a temporal stream
  2. var orderStream = ordersSimple.ToPointStream(cepApp, s =>
  3. PointEvent.CreateInsert(s.StartTime, s),
  4. AdvanceTimeSettings.IncreasingStartTime);
  5.  
  6. // Create a query in two parts
  7. var queryOne = from e in orderStream where e.OrderID > 50 select e;
  8. var queryTwo = from e in queryOne.TumblingWindow(
  9. TimeSpan.FromDays(1), HoppingWindowOutputPolicy.ClipToWindowEnd)
  10. select new
  11. {
  12. OrderCount = e.Count()
  13. };
  14.  
  15. // Convert these templates into queries, bound to an output adapter
  16. var tracerConfig = new TracerConfig()
  17. {
  18. DisplayCtiEvents = false,
  19. SingleLine = true,
  20. TracerKind = TracerKind.Console
  21. };
  22.  
  23. var queryOneRun = queryOne.ToQuery(cepApp, "QueryOne", "",
  24. typeof(TracerFactory), tracerConfig, EventShape.Point,
  25. StreamEventOrder.FullyOrdered);
  26.  
  27. var queryTwoRun = queryTwo.ToQuery(cepApp, "QueryTwo", "",
  28. typeof(TracerFactory), tracerConfig, EventShape.Interval,
  29. StreamEventOrder.FullyOrdered);

However, this wouldn’t produce the desired result.  Instead, the StreamInsight engine will construct the query pattern seen in the diagram below – where queryTwo composes the design of queryOne, but not the runtime stream (i.e. creates two adapter instances).

This can be verified by using the debugger to check the input source of the query.  For details on how to use the debugger, see my blog post here.

  1. Open the Event Flow Debugger, and connect to your StreamInsight instance (walkthrough on using the Event Flow Debugger here).
  2. Navigate to your queryTwo definition, and Show Query.
  3. As seen in the diagram below, if the input adapter is an actual input adapter (and not a published stream) you have two independent streams each with their own input adapter.

 

In order to have the two queries compose at runtime, we need to:

  1. Publish the results of the first query as a published stream with a strongly typed output (published schemas cannot have anonymous types)
  2. Consume the published stream as the input source of the second query.

Updating the query syntax to take advantage of DQC looks like:

Code Snippet
  1. // Create a simple data source (oData feed), using a non-anonymous
  2. // type
  3. var ordersSimple = from o in northwind.Orders
  4. where o.OrderDate != null && o.ShippedDate != null
  5. select new NorthwindOrderResult
  6. {
  7. StartTime = (DateTime)o.OrderDate,
  8. EndTime = (DateTime)o.ShippedDate,
  9. OrderID = o.OrderID,
  10. ShipRegion = o.ShipRegion,
  11. CompanyName = o.Customer.CompanyName
  12. };
  13.  
  14. // Convert the data source into a temporal stream
  15. var orderStream = ordersSimple.ToPointStream(cepApp, s =>
  16. PointEvent.CreateInsert(s.StartTime, s),
  17. AdvanceTimeSettings.IncreasingStartTime);
  18.  
  19. // Create a query
  20. var queryOne = from e in orderStream where e.OrderID > 50 select e;
  21. var queryOneRun = queryOne.ToQuery(cepApp, "QueryOne", "",
  22. typeof(TracerFactory), tracerConfig, EventShape.Point,
  23. StreamEventOrder.FullyOrdered);
  24.  
  25. // Convert the query's output into a published stream (with a
  26. // non-anonymous type)
  27. var queryOneStream = queryOneRun.ToStream<NorthwindOrderResult>();
  28.  
  29. // Bind the second query to the published stream
  30. var queryTwo = from e in queryOneStream.TumblingWindow(
  31. TimeSpan.FromDays(1), HoppingWindowOutputPolicy.ClipToWindowEnd)
  32. select new
  33. {
  34. OrderCount = e.Count()
  35. };
  36. // Run the second query
  37. var queryTwoRun = queryTwo.ToQuery(cepApp, "QueryTwo", "",
  38. typeof(TracerFactory), tracerConfig, EventShape.Interval,
  39. StreamEventOrder.FullyOrdered);

Now that we’ve updated the query structures to use DQC, let’s take another look at the query structure in the debugger.  Note that the input source for the second query is now a published stream (as it is now bound to a URI source, not a direct input adapter).

There we go – we can now feed the run-time results of one query into another query using Dynamic Query Composition.

Hands-On Lab: Building Windows Azure Applications with the Caching Service

Recently my team quietly released an update to the Windows Azure Platform Training Course (the training course is similar to the training kit, with minor differences) to coincide with new services released at PDC10.  There’s a lot of nice updates in this release, including a new hands-on lab called Building Windows Azure Applications with the […]

Starting ALL.Exceptions 0xC00CD557

There are two binding files included in the ESB toolkit 2.1 that are made available if you want to make changes to the bindings.

WARNING: DON”T MODIFY THE BINDING FILES WITH AN INTELLIGENT XML MODIFICATION TOOL (like Visual Studio)

You will make the modifications, import the binding file, and it will import it correctly, and when you go to start the Microsoft.Practices.ESB, you will get this error:

The issue is that it changes the filter from:

<Filter>&lt;?xml version="1.0" encoding="utf-16"?&gt;
	&lt;Filter xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"&gt;
	&lt;Group&gt;
	&lt;Statement Property="ErrorReport.FailureCode" Operator="6" /&gt;
	&lt;/Group&gt;
	&lt;Group&gt;
	&lt;Statement Property="Microsoft.Practices.ESB.ExceptionHandling.Schemas.Property.FaultCode" Operator="6" /&gt;
	&lt;/Group&gt;
	&lt;/Filter&gt;</Filter>

to

<Filter>
        &lt;?xml version="1.0" encoding="utf-16"?&gt;
	&lt;Filter xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"&gt;
	&lt;Group&gt;
	&lt;Statement Property="ErrorReport.FailureCode" Operator="6" /&gt;
	&lt;/Group&gt;
	&lt;Group&gt;
	&lt;Statement Property="Microsoft.Practices.ESB.ExceptionHandling.Schemas.Property.FaultCode" Operator="6" /&gt;
	&lt;/Group&gt;
	&lt;/Filter&gt;
</Filter>

Lesson to learn: the filter settings within the binding file need to be correctly formatted xml (spaces before the first open carrot is illegal)

Making Azure apps configurable again with the new Azure PDC features

Early Thinking

This post describes some new Azure features and how they might help us in leveraging the power of the web/app.config files again.  The content is this article is written, before any CTP/Beta versions of these features are available, so the details might be incorrect and there might be some wrong assumptions.  I will verify all of these parts, once the features are made available.

Current situation

Until now, an important difference between deploying a web application (or web service) on a local or hosted server and deploying a web application (or web service) to Windows Azure was the usage of the web.config file.

In a standard web application (hosted on IIS), the web.config can easily be changed to update configuration settings.  When changing this file, the web application gets refreshed and the new settings are being applied.

On Azure, there was a total different story.  The web.config was compiled with the deployment package and to change it, a new version of the packaged needed to be uploaded, resulting in a lot of work/time before the new settings got applied.  Luckily, Windows Azure provided a nice alternative: the serviceconfiguration files (.cscfg).  This file allowed to specify configuration values that could be loaded at runtime through the following code:

RoleEnvironment.GetConfigurationSettingValue("myValue"); code.

Painpoints with the Azure serviceconfiguration files.

The idea is great, having service configuration files managed on Role level and not on instance level.  But there are some big disadvantages in the following scenarios:

WCF Configuration settings

WCF has tons of configuration settings and I am a big fan of having my service endpoints configured through the .config files.  This allows for easy change and full declarative configuration, without having the settings (binding/behaviors) compiled with the program.  And since the introduction of the WCF Router service, even more configuration (the pub/sub logic) gets in the .config file.

Having all these settings in the Azure .cscfg file, would be very hard to maintain, or we’d need to switch to custom configuration files.

Custom configuration settings

In most of the applications that are developed at Codit, we use custom configuration sections to have a better structured configuration experience.  These configuration sections are complex types and no standard name/value configuration pairs.  Migrating these applications to Azure, would mean our configuration logic would need to be totally redesigned.

ASP.NET settings

ASP.NET also include a lot of settings that might need to be changed at runtime.

PDC announcements

At PDC a lot of stuff was announced that can help us here.  This article described the various announcements and their impact on the configuration issues I described above.

Remote desktop capabilities

Through the updated Azure management portal (didn’t that look a 100 times nicer than the current one?), we will soon be able to have Remote Desktop access to our web.  This will be done by adding the following Modules in the service definition file (.csdef)

<Imports>

<Import moduleName="RemoteAccess" />

<Import moduleName="RemoteForwarder" />

</Imports>

This allows us to connect to a running instance of an Azure role.  This way we can alter the web.config file and have everything updated as on a regular web application.

The biggest disadvantages of this approach are the following:

  • When having multiple instances (which is required to have High Availability), we need to remote in on every running instance of our web role.
  • Our changes will be undone when our instance restarts or gets redeployed, because the machine gets ’prepped’ again, resulting in a fresh installation of our Azure package.

The new Azure VM Role

Through the announced Windows Azure VM Role, we will be able to customize our own Virtual Machine, by uploading a pre-built virtual hard disk (VHD) to a blob storage account.

The steps to do this are the following :

    • Install Windows Server 2008 R2 Enterprise on the VHD
    • Add any Additional software you might need on the VM Role instances
    • Install Windows Azure Integration Components that include the following components
      • Agent
      • Runtime interface (topo, config, shutdown notification)
      • Remote Desktop configurator
      • Windows Azure Drives driver
    • Generalize the VHD is recommended, by using sysprep  (machine name will be assigned by Azure.)

By using a difference VHD, it might be easy to upload a new version of that VHD with the updated configuration file on it and have the changes applied.  Besides that, the same approach can be taken as described in the previous section (remote desktop capabilities).

The biggest disadvantages of this approach are the following:

  • To upload a new version of the VHD difference disk, the role might need to be reinitiated (to be tested, once the VM Role is available for CTP)
  • Cumbersome way of changing the web.config.

Startup tasks

As shown in the CloudCover show of two weeks ago (watch episode), there is a possibility of executing startup tasks, when the role instance starts up.  This looks like the best suited feature to solve our config file problem.

I am making one crucial assumption here (that I’ll check once this is made available):  I believe the start up tasks are being executed prior to the Role Instance initiation – so before the web application is started.  This means we can still change the web.config without having the web application being recycled automatically.

Leveraging the startup tasks will allow us to take the web.config from a configurable blob container and write it to the application directory on the Azure instances.  Therefore, we just need to write a script that performs this logic.  (code will be in a future post).  Then we just need to configure that script in the Startup element in the csdef configuration file:

<Startup>
     <Task commandline="updateconfig.cmd" executionContext="elevated" 
               taskType="simple/foreground/background"
/>
</Startup>

This approach looks like the best approach to make our web.config and app.config files configurable again.

Conclusion

A lot of uncertainties, because there is no bit available yet to test this with.  So, please expect a reviewed post, once it has been made available. 
But one thing is for sure: the new Azure features will make Azure application development much more flexible again.

Sam Vanhoutte, Codit

London Connected Systems User Group Session

EMC Consulting will be hosting a ’Connected Systems’ user group session at their London office on Tuesday 7th December. 

What is ’Connected Systems’ you ask? Well, this encompasses any technology that is related to connecting systems together, which happens to be quite a broad subject. The user group focuses on Microsoft technology in particular such as WCF, WF, Azure and SSIS but is keen to also cover patterns and practices, those that are technology independent. Essentially, if you have experience or an interest in working on solutions that require any interaction with an external system then this user group could be appealing.

The first event contains two sessions. The first will be Liberating Identity using Windows Identity Foundation by Simon Evans. The second will be on some work by Prasanna Krishnan relating to Large Data Streaming with WCF

This is the inaugural session and we are very interested in hosting many more events. The venue will be available for free use, so the only concern is making sure we have people that can provide some interesting content they wish to share with the rest of the community. Please feel free to come along and offer suggestions for material going forward. Alternatively, contact me directly.

For details on the first event and register your place now, please visit http://lcsug.eventbrite.com/

Upcoming Web Camps

Earlier this year I blogged about some Web Camp events that Microsoft is sponsoring around the world.  These training events provide a great way to learn about a variety of technologies including ASP.NET 4, ASP.NET MVC, VS 2010, Web Matrix, Silverlight, and IE9.  The events are free and the feedback from people attending them has been great.

A bunch of additional Web Camp events are coming up in the months ahead.  You can find our more about the events and register to attend them for free here.

Below is a snapshot of the upcoming schedule as of today:

One Day Events

One day events focus on teaching you how to build websites using ASP.NET MVC, WebMatrix, OData and more, and include presentations & hands on development. They will be available in 30 countries worldwide.  Below are the current known dates with links to register to attend them for free:

City Country Date Technology Registration Link
Bangalore India 16-Nov-10 ASP.NET MVC Already Happened
Paris France 25-Nov-10 TBA Register Here
Bad Homburg Germany 30-Nov-10 ASP.NET MVC Register Here
Bogota Colombia 30-Nov-10 Multiple Register Here
Chennai India 1-Dec-10 ASP.NET MVC Register Here
Seoul Korea 2-Dec-10 Web Matrix Coming Soon
Pune India 3-Dec-10 ASP.NET MVC Register Here
Moulineaux France 8-Dec-10 TBA Register Here
Sarajevo Bosnia and Herzegovina 10-Dec-10 ASP.NET MVC Register Here
Toronto Canada 11-Dec-10 ASP.NET MVC Register Here
Bad Homburg Germany 16-Dec-10 ASP.NET MVC Register Here
Moulineaux France 11-Jan-11 TBA Register Here
Cape Town South Africa 22-Jan-11 Web Matrix Coming Soon
Johannesburg South Africa 29-Jan-11 Web Matrix Coming Soon
Tunis Tunisia 1-Feb-11 ASP.Net MVC Register Here
Cape Town South Africa 12-Feb-11 ASP.Net MVC Coming Soon
San Francisco, CA USA-West 18-Feb-11 ASP.NET MVC Coming Soon
Johannesburg South Africa 19-Feb-11 ASP.Net MVC Coming Soon
Redmond, WA USA-West 18-Mar-11 Odata Coming Soon
Munich Germany 31-Mar-11 Web Matrix Register Here
Moulineaux France 5-Apr-11 TBA Register Here
Moulineaux France 17-May-11 TBA Register Here
Irvine, CA USA-West 10-Jun-11 ASP.NET MVC Coming Soon
Moulineaux France 14-Jun-11 TBA Register Here

Two Day Events

Two day Web Camps go into even more depth.  These events will cover ASP.NET, ASP.NET MVC, WebMatrix and OData, and will have presentations on day 1 with hands on development on day 2.  Below are the current dates for the events:

City Country Date Presenters Registration Link
Hyderabad India 18-Nov-10 James Senior &
Jon Galloway
Already Happened
Amsterdam Netherlands 20-Jan-11 James Senior &
Scott Hanselman
Coming Soon
Paris France 25-Jan-11 James Senior &
Scott Hanselman
Coming Soon
Austin, TX USA 7-Mar-11 James Senior &
Scott Hanselman
Coming Soon
Buenos Aires Argentina 14-Mar-11 James Senior &
Phil Haack
Coming Soon
S%u00e3o Paulo Brazil 18-Mar-11 James Senior &
Phil Haack
Coming Soon
Silicon Valley USA 6-May-11 James Senior &
Doris Chen
Coming Soon

More Details

You can find the latest details and registration information about upcoming Web Camp events here.

Hope this helps,

Scott

San Diego User Group Meeting Nov 23, I’ll be doing a Windows Azure Pre-conference Session

We are a little slow getting invitations out and details published, but there are two Windows Azure events coming up in San Diego in the next couple of weeks:

  • On Sat December 4th, we will be hosting our second all-day Azure event
  • Prior to that, this Tuesday, I will be doing a “pre-conference” event at the main user group meeting, description below

The Tuesday meeting will be at the Intuit campus, details at http://sandiegodotnet.com. Registration for the conference will be available there shortly.

 

=============================

Windows Azure Pre-con

Cloud technologies are transformational, and one of those rare paradigm shifts that we don’t see often. The Windows Azure platform represents a tremendous investment by Microsoft, one that developers can benefit from today. Some of the results of those investments are live today, and you can use them to enable solutions that previously would have been impossible or prohibitively expensive to create.

The San Diego .NET user group is committed to our mission of bringing you the knowledge you need on current and emerging technologies, and as such will be hosting our second Azure conference on Saturday December 4th (invitations/details in the next couple of days). The conference will cover a variety of topics, and will dive relatively deeply into architecture and development (covering architecture, data, migration, green-field and more).

To ensure our members get maximum benefit our of the conference content, Brian Loesgen, an architect evangelist with the Microsoft ISV team, will be doing a pre-conference meeting to help our members ramp up on, and get current with, the Azure platform.

This session will provide:

  • Windows Azure, technical overview, covering all the components in the Azure platform
  • Windows Azure tooling: the developer experience (demo, demo, demo)
  • PDC 2010 Azure update: what’s new? What changed? What’s coming?
BizTalk Mapper Extensions UtilityPack available on CodePlex

BizTalk Mapper Extensions UtilityPack available on CodePlex

I am delighted to announce “BizTalk Mapper Extensions UtilityPack”. This is my first contribution in CodePlex with a BizTalk Open Source project. Project Description BizTalk Mapper Extensions UtilityPack is a set of libraries with several useful functoids to include and use it in a map, which will provide an extension of BizTalk Mapper capabilities. Conversion […]