CRM Blog

CRM & Multi-Tenancy

by Danny Varghese 10.08.09

How does Microsoft Dynamics CRM handle multi-tenancy?  What is multi-tenancy?  These are the questions I often get from clients and other developers just interested in the CRM architecture.

 

Multi-tenancy allows CRM to be deployed on a single server, but allows multiple organizations to be supported.  For example, say a company has two business units like Commercial and Retail.  If there is a need for that company to use CRM differently for each business unit, that's where multi-tenancy can play a key role.  We can create a tenant for each unit, and each business unit can have it's own configurations and customizations.  So how does the CRM architecture handle multi-tenancy?

 

There are two ways new tenants/organizations can be created.  One way is using the CRM Deployment manager tool.  When setting up CRM for the first time, there is a default organization (tenant) created.  The Deployment Manager creates a new URL each time a new organization/tenant is created.  For example, we can use this to create Commercial and Retail tenants. The url is usually in the format http://<server: port> /tenant/page.aspx.  The Deployment Manager also creates a new database named “<tenant>_MSCRM” on the specified SQL Server, and creates all CRM tables, filtered views, etc.  It then updates the MSCRM_CONFIG database (base CRM database) with the information for the newly created tenant/organization.

 

For example, when setting up CRM for the first time, say a user sets up a default organization to be CroweHorwath on the local host, then the url would be: http://localhost:5555/CroweHorwath OR since this is the default organization, one can type http://localhost and it will default to the CroweHorwath tenant.  Then a user can use the Deployment Manager tool to create a new tenant for the Commercial business unit.  When the user is finished, the new url will be http://localhost:5555/Commercial, and a new database Commercial_MSCRM will be created to hold all configurations/data for the Commercial tenant.

 

One more thing, virtual directories are not created for every organization. CRM implements a virtual path provider that parses the URL to figure out which organization you are accessing and to perform the correct authentication.  CRM uses a web service and the user’s windows credentials to go against active directory and the appropriate organization to authenticate.

 

The second way tenants can be creates is programmatically using the CRMDeploymentService.asmx (http://<server>/MSCRMServices/2007/CrmDeploymentService.asmx).   One would have to use code to create a new CRM organization object, set the following fields: name, SQL server name, SQL server url, CRM currency information.    Next create a new instance of the CRM Deployment web service and use that to create a new Create response and request objects.

 

The above is a brief explanation of how multi-tenancy works in Microsoft Dynamics CRM.  I hope this will clarify many of the questions out there!

Filed under:

Comments

No Comments

Leave a Comment

(required) 
(required) 
(optional)
(required) 
Security Check
Please answer the simple math problem below.

(required)