Wednesday, December 15, 2010

MS CRM 2011, the “Cloud”, Azure and the future

Something really important is happening right now, and if you are involved in MS CRM take notice or fall by the wayside!  This is a real game changer!

Almost all of my MS CRM installations were on premises installations until just this Fall.  Sure there were IFD configurations and web portals with Silverlight etc., but the customer was always in tight control of the servers, even if the servers were hosted.

I thought the next big thing would be the tighter SharePoint 2010 integration with MS CRM 2011 and to be fair I have seen interest in that and it will be a growing thing.

What I didn’t expect is that suddenly I would almost exclusively be working with hosted MS CRM systems, MS CRM Online and Windows Azure and SQL Azure. BTW I’ll be working with the new SQL Azure Reporting Services CTP this week as well.

What is pretty obvious is that MS has a lot of technologies coming together at about the time that MS CRM 2011 is hitting the scene. Frankly I thought it all looked interesting, but I didn’t expect the market to react so quickly or for it all to fit together so well.

What I also didn’t expect was how much I would enjoy this transfer of responsibility. I enjoy being in control of things, but I also love abstracting away busy work to concentrate on solving real problems.  That is the point of MS CRM. System administration work is not where the fun is, at least for me.

I was also pleasantly surprised at how easy using SQL Azure is. Just make sure you are using SQL 2008 R2 Management Studio and it is really nothing more than setting up an IP range you will be connecting through in the Azure portal, and changing your connection string. All of your tables need to have Clustered indexes as well and you have to use SQL scripts for all of your modifications, but otherwise it is just like the SQL you already know. Another thing to beware of is that the Web database is 1-5Gb and if you expect to grow beyond that you need to start with a Business Database which starts at 10Gb and can grow to 50Gb.

I’m currently working on a project that is using an Azure 10Gb database, the new to SQL 2008 geography fields and spatial indexes. I imported about 7Gb of data in about 3.5 hours. The database has been very responsive.  I did notice that when I ran a very intensive task like generating a Spatial index across 9.2 million records that it would occasionally idle my process, but it still finished in a respectable time.

Windows Azure, likewise, was very easy to set up.  Install the Azure SDK, create a Cloud Service Project, setup the Diagnostics and build a web application. If you make the Cloud Service your Start project it can be debugged locally as it will be deployed. There are a few configuration switches, but then again you are abstracting away all of the IIS administration.

Where this all gets interesting is that additional instances of your application can be added with a few key clicks and without purchasing equipment or understanding anything about network load balancing. Adjust the amount of CPU cores and memory your application needs as it grows.  Scale it back during the off season or grow though the ceiling.

I have customers who want to scale up quickly to compete with some pretty large competitors with a better product, but without the infrastructure or small army to maintain it. The Azure platform allows a small guy with a better mousetrap to take on the world.

As a lone gun for hire, without a staff of sysadmins, what this means to me is that I can create some really really big solutions very quickly and without the setup time normally involved, or the meetings with IT departments to budget for servers, and schedule for installation and configuration.

What this also is going to do is let a lot more killer apps actually see the light of day. I think we are going to see a new wave of enabled developers make a lot of really cool things happen.

The cost of admission to see if something will stick has really dropped and if your solution is really that good and your website is nailed with traffic, all you need is a few key clicks to give you more bandwidth, memory and processing power.

I was a bit skeptical at first, but as the saying goes, “People vote with their wallets”.  Based on what I am seeing the people are voting and much quicker than I expected!

Thursday, November 11, 2010

MS CRM Custom Workflow CreateCrmService permissions

If you are writing custom workflows and calling CRM services, you are probably familiar with the following code which creates a service with system administrator access to all data.  ( true = administrator access )

ICrmService service = context.CreateCrmService(true);

You may have noticed that any entities created by a custom workflow using this administrator access default to being created and owned by the account that your Microsoft CRM Asynchronous Processing Service runs as.

This has some trickle down depending on the account your async service is using.

For example if you are using the Local System Account which “typically” does not have a CRM user account dedicated to it, there are some things that you won’t have permission to do.

For example the Local System account doesn’t have permission to send an email and the following will fail even with a service having administrator access.

var sendRequest = new SendEmailRequest
EmailId = emailId,
IssueSend = true,
TrackingToken = String.Empty


This will give you the following SoapException:

  <description>An unexpected error occurred.</description>

You could create another service reference like below just to send email with which will work as long as the user running the workflow can normally send an email from a workflow.
ICrmService sendEmailService = context.CreateCrmService(false);

You could also use a CRM user CAL and create a CRM user for the account your async service runs as.

The important thing to realize is that any service request that requires user configuration in order to function beyond security role permissions will be dependent on whether there is a CRM user assigned to the account the acync service is running under and how that CRM user is configured. For example: whether the email access type is E-mail Router.

Wednesday, September 29, 2010

Developing for CRM 2011 and SharePoint 2010 Foundation

If you are a MS CRM person looking at SharePoint as something new here are a few things that may be of interest.

The SharePoint 2010 Foundation is free and will work with the MS CRM list component but it is limited to database sizes of 4Gb. This makes it much easier to leverage some of the power of SharePoint for your CRM customers. Your customers by default already have licensing for Windows Server and SQL Server in order to run MS CRM and SharePoint Foundation can share that same server.

In addition the new Business Connectivity Services (BCS) are also supported by SharePoint Foundation:

BCS will allow you to expose data from other databases to show up in SharePoint, but not take space in the SharePoint database, this of course includes CRM data. There is obviously a performance penalty depending on the interface to access this external data, but it also allows maintaining legacy databases while having access to that data in SharePoint without passing the 4Gb database limit in the SharePoint database.

If you are looking at SharePoint integration using their web services, you can see from the following link which services are supported by both SharePoint Foundation and by SharePoint Server and just by SharePoint Server.

As an obvious guideline it would make sense to write your base code to support SharePoint Foundation to let customers try out SharePoint functionality, and to have any features that require SharePoint Server features be switchable at a later time if your customer upgrades.

SharePoint Server has a number of useful features shown in this version comparison that you may or may not need:

As a practical note, SP 2010 is built on .NET 3.5 and CRM 2011 is built on .NET 4.0, so while most of you will not have a lot of .NET 4.0 legacy code at this point, is will be important to make sure your libraries with logic that will be shared between SP and CRM components are all kept at .NET 3.5.

Sunday, September 26, 2010

Connecting to MS CRM 2011 outside the VM

While the CRM 2011 VM created so far works well by itself, you will most likely want to access MS CRM web site, web services and endpoints from outside the VM for development purposes.

To do this you will need to set up VirtualBox to allow access from your host computer.

1. With your VM shutdown, modify the Network Settings and enable the second Adapter. As shown below:

  • Attached to: Host-Only Adapter
  • Name: VirtualBox Host-Only Ethernet  Adapter


Note: when a VM is created from scratch it appears to select the correct network adapter type. When I copied the VDI file to my laptop and setup a VM based on that VDI file, it picked a different adapter by default and the networking didn’t work until I made it match the original Network settings that I had when I first configured it.

2. Start up your VM, open up a command prompt and run  ipconfig. Notice the new Local Area Connection 2 should be in your local network. The other is the default NAT adapter that allows your VM to see the Internet as your host computer.


3. On your host computer go to C:\Windows\System32\drivers\etc and edit your hosts file and add the new IP address to your hosts file.


4.You may want to add a new Credential to your Credential Manager to reduce your login time under Control Panel since you are not in the domain of the VM.

Use the Hosts alias created above, then add a domain\username, and password. This will give you a mostly filled out login when you try to reach the website for the first time.


5.  Test the connection out by bringing up MS CRM on your host. I’m using the alias in my hosts file pull up CRM.  http://w2008r2crmdev:5555/CRMDEMO


6. Now make sure you can access the endpoints through the browser



7. If the endpoints show up in the browser than they should be available to add a reference to a Silverlight project as shown below.

VS Service Reference MetaData

Side Note: I have found that this VM is capable of running with 2.3Gb of RAM and on one core on my 2 year old Core Duo laptop. There is just enough memory to run VS 2010 on the host and connect to the guest VM’s endpoints as shown above in the 4Gb of RAM my laptop has. This is by no means an optimum configuration, but it is possible to demonstrate CRM 2011 beta with SharePoint integration and write code against both SDK’s.

Tuesday, September 21, 2010

MS CRM 2011 SharePoint List Component Installation

Warning if you downloaded the file just as this was introduced it contains an unsigned assembly that will give you an error message shown when you would see it during the installation below. A fix was put out by MS a few days later. If in doubt download it again.

Download the SharePoint List Component
CRM2011-SharePointList-ENU-amd64.exe file and run it on your VM.

Accept the Conditions

Pick a place to unpack the contents. You will be browsing to the crmlistcomponent.wsp file from SharePoint later.


Before installing the List component you need to relax the Browser File Handling to “Permissive” for the Web application that you are sharing with MS CRM 2011.

Go to SharePoint Central Administration and click on Manage web applications.


Select the web application that you are sharing with MS CRM and click on General Settings.


Scroll down to Browser File Handling and click on permissive then scroll to the bottom and click OK.


Now visit your SharePoint Site and click on Site Actions then Site Settings.


Click on Solutions under Galleries


Click the Solutions Tab, and a ribbon will appear. Click on Upload Solution in that Ribbon.


Now browse to the crmlistcomponent.wsp file that was unpacked earlier and click OK.


Now you need to Activate this solution.


Note: The error below will only happen if you are still using the Initial download of the CRM2011-SharePointList-ENU-amd64.exe file. 


You should see this if you have the right version.


The SharePoint List Component is now in place.

To test this in CRM.

Go to Settings, Document Management and click on Document Management Settings.  Enter your shared SharePoint site. Click Next


You can pick Account, Contact or not select where you Document Library will be based. I selected Account below.  Click Next



When it is all done, click finish.

Create a Test Account if you don’t already have one. Add a document of some kind. It will prompt you for a location to automatically create a SharePoint Folder the first time you do this per Account. Click OK.


Click the Open SharePoint link to see the document in SharePoint. Both sides can now work with documents in this folder.


Sunday, September 19, 2010

MS CRM 2011 Beta VM Continued.. Customizations

As my instructions left off, trying to publish a CRM customization and exporting customizations will fail with a SQL error. This is because the administrator currently doesn’t have adequate permissions.

Since the Administrator account has the Administrator security role this should not be an issue.

In a production system we should not be giving the Administrator account direct  access the <orgname>_MSCRM database as dbo in SQL Management Studio, but that will work for the VM. However I believe the user should instead belong to a group with the proper permissions. In this case I added the Administrator user to the SQLAccessGroup as shown below which had adequate permissions.


Wednesday, September 15, 2010

MS CRM 2011 Beta VM continued…

There is going to be plenty more to this VM and the CRM beta to work on as we learn more about this new release.

More Building Blocks are needed.

Using steps in the previous section make sure that the SharePoint websites are stopped.  Also stop the SharePoint services below. This will dramatically speed things up.


Unpack the Beta SDK

Install the CRM 2001 SDK,  using MicrosoftDynamicsCRM2011BetaSDK.exe

Double click and pick a folder to use. I chose  C:\CRM2011BETASDK

Build the Plug-in Registration Tool

Open VS 2010
Open the solution in  C:\CRM2011BETASDK\sdk\tools\pluginregistration


Debug the solution to make sure it works.

Enter the URL of your CRM website, and check Use Saved Credentials and click connect.


Click Connect again and you should see that the Plug-in Registration tool is working.


For testing purposes you can just run the copy out of the bin debug folder or put a copy on a folder on your desktop.


SQL Reporting Services ( Configure Data Source )

Now that CRM is installed we need to revisit Reporting services and configure the MS CRM_DataSource

Go to Reporting Services in Internet Explorer:

image Click on SharedReports
Click on 5.0.xxxx
Click on Details View since the datasources are hidden by default.


Click on MSCRM_DataSource. (obviously adjust the following for your organization name and server name )

  1. Change the Data source type to:  Microsoft SQL Server
  2. Change the Connection string to:  Data Source=W2008R2CRMDEV;Initial Catalog=CRMDEMO_MSCRM;Connection Timeout=60;Integrated Security=SSPI
  3. Click on Windows integrated security.
  4. Click on Apply
  5. Click on Test Connection

You should see: Connection created successfully. as shown below.


You should now be able to test out a CRM report.
I just pulled up the Account Distribution Report at the top of the list. image

That wasn’t really impressive since this VM has almost no data in it, but there were no SSRS errors and that is the important part.


Sunday, September 12, 2010

Creating a MS CRM 2011 VM Part 2 of 2

Performance Note: VirtualBox allows you to set more CPU’s for your virtual machine than you should. I ended up using 3 CPU’s for my i7 although it is a hyperthreading and shows 8 cores. I found it MUCH faster set to 3 CPU’s instead of say 4.

To speed the installation up turn off the SharePoint Websites for now. Go to IIS Manager and stop the SharePoint sites. You may want to leave this off until installing the SharePoint List component in MS CRM and you will probably only want these turned on when you are using SharePoint, otherwise they

Visual Studio 2010 Installation

VS 2010 is a very straight forward installation. It also installs a number of other prerequisites needed for MS CRM 2011 like .NET 4.0.

Mount your VS 2010 iso image and select it.image


When that is complete you may want to make another snapshot of your VM.

At this point your VM’s dvi file should be about 21Gb in size.


Reporting Services Installation

Go to the Start button and click on All Programs

Microsoft SQL Server 2008 R2 –>Configuration Tools –> Reporting Service Configuration Manager


Click Connect


Click Web Service URL  then Click Apply



Click on Database and Change Database


Create a new report server database image

Click Nextimage

Click Nextimage

Click Nextimage

Click Next

Click Finishimage

Click on Report Manager URL and click apply.

Once again this is a test VM, so I gave this my Administrator account. You probably won’t be be using connectivity to remote servers anyway.image  


This is good enough for the MS CRM installation to finish successfully.


MS CRM 2011 Beta Installation

Included in the download area is the file containing:  MicrosoftDynamicsCRM2011BetaInstallingGuide.doc

You can refer to that document if there is anything in my instructions below that you need more information about. Page 13 starts “Install Microsoft Dynamics CRM 2011 Server on a server without Microsoft Dynamics CRM installed

Start by going to you shared folder where you need to copy the CRM2011 executables that you need and copy them to the VM’s desktop. For now we just want the CRM Server and the SharePoint List component.


Create a CRM2011Beta folder on your desktop and click on the CRM2011-server-ENU-amd64.exe file and extract the contents into this folder.

Open the CRM2011Beta folder –> server –> amd64
Double click on setserver.exe


The Beta was just released so there is no point in getting any updates yet.


MS CRM Workgroup (5 CAL limit): FF2JM-QX9PG-HXT8M-MMHXG-4MF32
MS CRM Server (no CAL limit): 4FDTK-3HYV2-D9CCJ-4MF9Q-QJ32X

Next put in the appropriate key above.  Notice the 270 day expiration period!


Accept the license agreement.

Install the prerequisites.



Select an installation location or keep the default.


Click Next and install all of the roles.


Type in the name of your VM Server.

Click Browse and just select the top node. Click OK and Next.


Specifying a Security Account. For a production system you will not want  to do this, but for our demo system, just select Network service account.  There is an additional step required for the SharePoint document management feature when doing this.


You want to create a new website to avoid any conflict with SharePoint and other sites. Keep 5555 for the port. You should have selected 9999 for the SharePoint site if you followed the instructions.


We are NOT going to set up an Email router at this time. Notice the note. This can be done later.  (Setting up Exchange Server and Outlook on a test environment is worth doing especially with the new multi-tenant support in Outlook)


Pick an organization name for your system. It will name the Database automatically. Leave the rest alone.


Take the default reportserver name unless you have installed it somewhere else.


Decide if you want to take part in the use experience and click Next.



Next Installation




It may sit like this for a while. Be patient…image

Getting close now.  Check the box to set up the SSRS extensions, and click Finish!



Installing the SSRS Connector

If you decided not to start this when the CRM installation finished. On your desktop go to the srsdataconnector folder  CRM2011Beta\server\amd64\srsdataconnector  and Double click on the file SetupSrsDataConnector.exe


Click Next

Accept the license agreement


image  image


The warnings are OK for a demo, development box.  Click Next.  image




The Moment of truth….


At this point I shut the system down. It was apparent that it was running out of memory with 4Gb RAM. So I shut it down to make a snapshot and to increase the memory to about 6Gb to see if that was usable.

It seemed much faster after the reboot. It is interesting to note that it is only using about 2.5Gb of RAM without SharePoint running.


Now turn on the SharePoint Sites again.image

Create a SPList folder on your desktop. Copy the  CRM2011-SharePointList-ENU-amd64.exe  file from the Shared Folder areato the VM’s desktop and double click on it.


Browse to your new folder, and click OK.


Read the following inside the SPList folder for instructions to install the SP List Component.


More to come. I have to do something else for a little while…

Good luck with the new Beta!