Skip to main content

Deploying the Dynamics 365 Rule Execution Web Service

1: Open Your "RuleExecutionOnPremService" Folder​

For guidance on how to find this folder, reference the "Required Files" section above. The folder will need to be copied onto the IIS server you set up your website on in the previous section.

Windows File Explorer showing the RuleExecutionOnPremService folder with DeployScript.ps1, InRule.Crm.WebService.deploy.cmd, InRule.Crm.WebService.deploy-readme.txt, InRule.Crm.WebService.SetParameters.xml, InRule.Crm.WebService.SourceManifest.xml, InRule.Crm.WebService.zip, and WebDeploy_amd64_en-US.msi

2: Open the InRule.Crm.WebService.SetParameters.xml File in Notepad or a Similar Text Editor​

<?xml version="1.0" encoding="utf-8"?>
<parameters>
<setParameter name="IIS Web Application Name" value="InRule.Crm.WebService" />
<setParameter name="UseInRuleCatalog" value="true" />
<setParameter name="CatalogUri" value="http://localhost/inrulecatalogservice/service.svc" />
<setParameter name="CatalogLabel" value="LIVE" />
<setParameter name="CatalogUser" value="admin" />
<setParameter name="CatalogPassword" value="password" />
<setParameter name="CatalogSSO" value="false" />
<setParameter name="RuleAppDirectory" value="C:\RuleApps" />
<setParameter name="DynamicsCRM-Web.config Connection String" value="AuthType=AD;Url=; Domain=domain; Username=; Password="/>
</parameters>

3: Change Placeholder Parameter Values to Real Values​

#ParameterDescription
1IIS Web Application NameThe name of your IIS website as defined in the "Setting up the Catalog Web Service in IIS" section
2UseInRuleCatalogDefines if the catalog is being used to store rule apps. Set to true if using the catalog, and false if using file system
3CatalogUriThe URI for the Catalog Service that will be used
4CatalogLabelDefines the label text used to by the service to target the specific rule app in the catalog. Labels are assigned to rule apps in the catalog
5CatalogUserUsername for Catalog Service, default value is 'admin'.
6Catalog PasswordPassword for Catalog Service, default is 'password', please change this using the catalog manager!
7CatalogSSODefines whether to use app pool identity to authenticate to the catalog web service
8RuleAppDirectorySpecifies the directory where rule apps will be stored if using file system instead of the catalog. If using the catalog, leave as-is.
9DynamicsCRM-Web.config Connection StringProvide a Dynamics connection string. Information on connection string formatting can be found here: https://docs.microsoft.com/en-us/dynamics365/customerengagement/on-premises/developer/xrm-tooling/use-connection-strings-xrm-tooling-connect

Important: Some customers have reported needing to provide a username in the format "domain\username" in order to successfully connect using IFD.

4: Save Your Changes​

5: Launch PowerShell as an Administrator​

6: Navigate to the "RuleExecutionOnPremService" Folder​

PS C:\InRuleForMicrosoftDynamicsCRMIntegrationFramework\RuleExecutionOnPremService>

7: Run the "DeployScript.ps1" File​

PS C:\InRuleForMicrosoftDynamicsCRMIntegrationFramework\RuleExecutionOnPremService> .\DeployScript.ps1

Observe that no errors occur while this script does its work.

It is worth noting that when deploying plugins without isolation in an on-prem environment, Dynamics requires that the user registering the plugin must be added as a Deployment Administrator from Deployment Manager. If the registering user lacks the proper permissions, when deploying the package Dynamics will return an error stating "Assembly must be registered in isolation."