Prepare for portal development (Dynamics CRM 2013)

 

Applies To: Dynamics CRM 2013

This topic begins with background information and best practices for portal development using Developer Extensions for Microsoft Dynamics CRM 2013 and the portal developer’s toolkit, and then walks through the installation and setup needed to begin.

In This Topic

Best practices for portal development

Install the base portal solution

Generate early bound types

Best practices for portal development

The following is a set of guidelines that you should investigate to determine the right approach for your organization. Note that this list is by no means exhaustive but represents the bare minimum of what you should consider when deploying a web portal that connects to your Microsoft Dynamics CRM system.

Deployment recommendation

Description and more information

Deploy your portal under SSL

It is imperative for organizations to be able to conduct private, tamper-proof communication with known parties. To ensure this, organizations should build a secure infrastructure based on public-key cryptography by using digital certificates with technologies such as Secure Sockets Layer (SSL).

Useful References:

How to implement SSL in IIS

Security Guidance for IIS

Security in IIS 6.0

Managing SSL Certificates in Azure

Review your anti-phishing approach

For any website that offers services that involve potentially sensitive customer and product data, your customers need to know that that they are interacting with your portal and not a phishing website. Before you set up any portal that connects to your Microsoft Dynamics CRM system, consider how your customers can identify your portal as authentic. More information: http://en.wikipedia.org/wiki/Phishing

Privacy recommendations

For any portal services you develop that work with Microsoft Dynamics CRM and that access, collect, or disclose information about you, your customers, your employees, or your computer over the Internet, you should implement a consent capture mechanism and make available a clear and conspicuous notice regarding the uses of information recorded and exchanged through the portal.

Microsoft provides a number of guides on Internet security and privacy practices. You are strongly urged to review these resources before deploying any Internet portal that integrates with your Microsoft Dynamics CRM system. More information: Internet Security and Privacy

Restrict the use of the portal integration account

When you set up the portal you nominate an account that will be used by the portal to connect to Microsoft Dynamics CRM and perform create, read, update, and delete transactions. It is vital that this account is used solely for this purpose. Don’t use the account for other CRM system uses and make sure that if you are using a Microsoft account that this account is not used for any other websites or applications.

When you set up the Microsoft Dynamics CRM account, ensure that you assign it a security role that only performs the functions exposed by the portal. For example, if your portal reads campaign information and writes campaign responses, ensure that the CRM account used for this purpose only has those privileges. This helps minimize the potential damage if this account is compromised. It is important that you do not, under any circumstances, set the account up with System Administrator privileges.

Install the base portal solution

To begin you must install the base portal solution into your instance of Microsoft Dynamics CRM.

Import the customizations file

  1. Ensure that Pop-up Blocker does not cause errors during the import process. In Internet Explorer either turn off Pop-up Blocker (go to Tools -> Pop-up Blocker -> Turn Off Pop-up Blocker) or add your CRM site to the allowed sites (go to Tools -> Pop-up Blocker -> Pop-up Blocker Settings).

  2. Go into Settings -> Solutions -> Import

  3. Select the sdk\Solutions\PortalBase\MicrosoftXrmPortals_managed.zip solution package and review the package details.

  4. Select the check box to enable post import actions.

  5. While still under Settings -> Solutions, click Publish All Customizations.

  6. After the import process is completed, refresh your browser. For more information on the entities installed with this solution, see Manage portal content (Dynamics CRM 2013).

Generate early bound types

To prepare for developing a web portal, you must first use the code generation tool with the Microsoft.Xrm.Client.CodeGeneration extension. More information: CrmSvcUtil.exe extension usage and command-line parameters (Dynamics CRM 2013). In addition, read Best practices for portal development.

The following examples use the CrmSvcUtil.exe tool, with the Microsoft.Xrm.Client.CodeGeneration extension to generate the classes in the Xrm namespace and XrmServiceContext is specified as the service context name. Note that Microsoft.Xrm.Client.CodeGeneration.dll must be in the same directory as CrmSvcUtil.exe, or in the system global assembly cache, when you run this command.

CrmSvcUtil.exe /codeCustomization:"Microsoft.Xrm.Client.CodeGeneration.CodeCustomization, Microsoft.Xrm.Client.CodeGeneration" /out:Xrm\Xrm.cs /url:http://Crm/Contoso/XRMServices/2011/Organization.svc /domain:CONTOSO /username:administrator /password:pass@word1 /namespace:Xrm /serviceContextName:XrmServiceContext /serviceContextPrefix:Xrm

Your portal will need the following minimum required configuration.

<configuration>
 <configSections>
  <section name="microsoft.xrm.client" type="Microsoft.Xrm.Client.Configuration.CrmSection, Microsoft.Xrm.Client"/>
  <section name="microsoft.xrm.portal" type="Microsoft.Xrm.Portal.Configuration.PortalCrmSection, Microsoft.Xrm.Portal"/>
 </configSections>
 <connectionStrings>
  <add name="Xrm" connectionString="ServiceUri=...; Domain=...; Username=...; Password=..."/>
 </connectionStrings>
 <microsoft.xrm.client>
  <contexts>
   <add name="Xrm" type="Xrm.XrmServiceContext, Xrm"/>
  </contexts>
 </microsoft.xrm.client>
 <microsoft.xrm.portal>
  <portals>
   <add name="My Portal"/>
  </portals>
 </microsoft.xrm.portal>
 <location path="Services/Cms.svc">
  <system.web>
   <authorization>
    <allow roles="My Portal Administrators"/>
    <deny users="*"/>
   </authorization>
  </system.web>
 </location>
</configuration>

See Also

Portal developer guide for Microsoft Dynamics CRM 2013
ASP.NET web forms and data binding (Dynamics CRM 2013)
Manage portal content (Dynamics CRM 2013)
Portal authentication (Dynamics CRM 2013)
Use the Website Copy tool (Dynamics CRM 2013)
Portal walkthroughs (Dynamics CRM 2013)
Blog: Announcing the Customer and Partner Relationship Management Portals