Mar 052012
 

Mindthecloud.net is starting series of articles about MS Dynamics CRM and Azure. The main idea is to popularize some of the Azure architectural patters that can be utilized with MS Dynamics CRM. You might ask why, well …I do believe that Azure is a complimentary part of some XRM based solutions, we can easy leverage some cloud capabilities that will allow us/you to build more effective, scalable, flexible with fresh enthusiastic approach (but with the business value) systems. Series of articles will focus primarily on helping the users/partners/architects/developers understand how to use Windows Azure + MS Dynamics CRM 2011. I don’t want to say that Azure is THE ONLY available solution for some of the scenarios I rather just show you where Azure services are useful, and shows how you can use them in your own solutions.

Every article will have business scenario, proposed solution, pros and cons, I thought about sample “trivial” implementation but that depends if there will be some interests. Let’s start then, I’m not going to write any introduction to Azure there is a lot of books/msdn articles which talk in details about every available Windows Azure service, just go to Azure Developer Center and find a lot of videos guides etc. http://www.windowsazure.com/en-us/develop/overview/.

Business Problem

Company XYZ is using MS Dynamics CRM 2011 as system for creating orders. Dynamics CRM is hosted online (for that particular scenario it doesn’t matter where Dynamics CRM is hosted). Company XYZ has got business partner which fulfils their orders two branches in two different locations. Partner has business application which has to be hosted on premise in one of the locations where the stock is kept. Business decided that every 2 hours all orders created should be transferred to business partner, so we need secure reliable communication between CRM and this on-prem app without giving access to MS CRM for partner.

Solution

The proposed solution is one of many varieties which can be used to solve that business challenge. I’d like to use/utilize on of the fantastic capabilities which are offered by out of the box  Windows Azure Integration with Microsoft Dynamics CRM. MS Dynamics CRM 2011 has been integrated with the Windows Azure platform by coupling the Microsoft Dynamics CRM event execution pipeline to the Windows Azure Service Bus so effectively during save/update operation we can send processed information to Azure Service Bus. MS CRM 2011 can send those messages to service bus using 4 different contracts: queued, one-way contract, two-way contract, or a REST contract if you want detailed information please have a look here http://msdn.microsoft.com/en-us/library/gg334766.aspx . A queued contract in our case is probably the most interesting one, is using Service Bus Queues. Lets’ have a look at diagram

clip_image002

Advantages

What that kind of approach gives us.

Proposed architecture is based on brokered messaging “pattern”. The core components of the Service Bus brokered messaging infrastructure are queues, topics, and subscriptions, for now we’re going to concentrate just at queues. MS CRM sends the processed entity (order) directly to prepared queue. That queue acts as a buffer and can store orders for certain period of time called default message time to live. (Can be set on message or if not queue settings apply) moreover partner will connect just to queue not directly to our CRM application. Azure Service Bus Queues are using ACS claims and can utilize roles with ACS roles, every request must be authenticated so our communication is secure. Well we met all business requirements and we achieved even more. Let’s look at benefits summary.

1) Separation of concerns/decoupling. Partner doesn’t have to connect directly to our MS CRM app.
2) Secure and reliable cross-boundary communication.
3) Load-leveling buffer, this comes extra, partner receiver application doesn’t have to be developed as super scalable app just in case we overstressed it by sending huge amount of orders , queue acts as an buffer prevents overload.
4) We didn’t touch that subject but we also we have load balancing.
5) From that pub/sub is just “behind the corner” but that will be subject of next article.

p.s Credits to Marco Amoedo for review of that post.

All comments and suggestions are very welcome, if someone is interested in sample implementation I can prepare step-by-step tutorial.

Jan 072012
 

The title of that post i a bit “mysterious”  but let me first start with all the best wishes for a New Year. Last year was amazing hard work with cutting edge project, I had to relax from heavy development a bit and do something else. That’s where Netduino comes into play. Netduino is an open source electronics platform using the .NET Micro Framework.The .NET Micro Framework is a very cool development platform which makes it possible to write high level, code and deploy it onto micro devices. Netduino itself is a amazing microcontroller, runs.net you can use all Visual Studio features including debugging. Project that I did is pretty simple, one temperature sensor (DS18S20) (OneWire) connected to Netduino reads current temperature value and sends to WCF REST service hosted on Windows Azure, service publishes that value to queue and another worker roles picks that and sends to CRM Online. Full architecture is visible on the image bellow.NetduinoMeetsAzureArchitecture2

That particular project is very simple but proves that Azure is very flexible, scalable, easy to work and very efficient platform for “distributed/connected systems”. You can easily imagine some “network” of micro devices connected to Azure sending , requesting and processing data, or even some devices “driven” via cloud from your phone. I’d say sky is the limit. What is even more interesting MS Dynamics CRM again proved XRM nature first of all I didn’t have to spend a lot of time to build presentation layer and data model and moreover my data model had nothing in common with customers and relationships with them. UI utilizes graphical capabilities i.e charts and all of that is out of the box. See result on screens bellow. Full source code of that solution is attached to that post. If you are interested in “wiring” and “electronics” let me know I can guide you how to build circuit  etc ,but  picture is worth a thousand words so please find attached screenshots and images.

Netduino board with sensornetduino

 

Cloud Services

NetduinoMeetsAzure

MS CRM 2011 UI

NetduinoMeetsAzureUI

Update 1

Full source code of the solutions is available here . I was using OneWire sensor Netduino currently OOB doesn’t support that yet (It will be soon) but, there is a experimental firmware and driver which works . You can find it  at netduino forum.

Update 2

List of components : 1 mini breadboard , Nutduino plus , 1 resistor 4,7K , some wires , DS18S20 high-precision 1-Wire Digital Thermometer , 1 Windows Azure account , 1 MS Dynamics CRM Online account.

Update 3

Source code is a “R&D” version there are some parts that can be optimized i.e instead using “HttpWebRequest” I could use sockets etc.

Update 3

This source code is provided “as is” and without WARRANTY OF ANY KIND ,
The author of this program is not responsible for any data loss or any other  type of damage this software may  do to your systems. By using this software, you agree to use  it AT YOUR OWN RISK.

Nov 032010
 

PDC was full of “Azure” A lof of changes have been announced. You can find full list here
http://blogs.msdn.com/b/windowsazure/archive/2010/10/28/you-spoke-we-listened-and-responded.aspx and http://www.microsoft.com/windowsazure/pdcannouncements/
Personally most interesting one is new VMRole and Remote Desktop funcionality . It looks like “Azure” is/will be more then platform for developers/new applications (PaaS) .Virtual Machine (VM) role runs an VHD of a Windows Server 2008 R2 virtual machine. This VHD is created on-premises a and then uploaded to Windows Azure , even more in 2011 Azure will alllow creating images in cloud directly, for me that is quite a change and shift/expand from a platform-as-a-service provider (PaaS) to Infrastructure as a Service (IaaS). I’d like to see where this will go ? and how customers will adopt that technology anyway I think interesting time is comming (has come) , so please mind the cloud .

Oct 272010
 

Recipe for a good application CRM 2011-  Windows azure Cuisine

Ingredients :

  • CRM 2011 beta (Online)
  • Windows Azure Web Role
  • WCF Service
  • Claims based authentication (knowledge)
  • CRM 2011 SDK
  • Silvelight 4
  • Coffe
  • Developers
  • Visual studio 2010

Take all ingredients , together mix with architecture (like on screen bellow ).

Use plenty of coffe (if you prefer coke that’s fine ) and I almost forgot assing some developers to that project. First you should start with Azure Webrole for hosting WCF service . This WCF service has to communicate with CRM 2011 online so you need to season that with claims based authentication  be careful it’s a bit challenging (DeviceID has to be generated etc.), When all authentication problems are cooked , add some Silvelight app I recommend custom bindings , Update ServiceReferences.ClientConfig to yourname.cloudapp.net domain and then create azure package and publish that on Azure. Don;t forget to copy Microsoft.IdentityModel.dll :) then invite customer and enjoy :) .

I  tested that recipe and effect it’s preety amazing.

If you have any questions related to that recipe feel free to contact.

Oct 232010
 

Server to Server Impersonation for CRM Online from Windows Azure Hosted Service. MS Support Team published excellent article + sample application . This is next on my list  to test :) the walkthrough uses Windows Identity Foundation instead of RPS (Relying Party Suite),

http://code.msdn.microsoft.com/crmonlineforazure