InRule Solution for Dynamics 365 On-Premises Deployment
At this point, all of the InRule server components are setup. The rule execution service should be listening for incoming communication from Dynamics. We must now set up Dynamics. To make this process easier, we will be using PowerShell.
1: Launch PowerShell as an Administrator
2: Navigate to the \DynamicsDeployment Directory
PS C:\work\CRMIntegrationFrameworkTesting\2.3.4.81\InRuleForMicrosoftDynamicsCRMIntegrationFramework\DynamicsDeployment\tools> cd..
PS C:\work\CRMIntegrationFrameworkTesting\2.3.4.81\InRuleForMicrosoftDynamicsCRMIntegrationFramework\DynamicsDeployment>
3: Execute Deploy-CrmPackage.ps1
For Dynamics On-Prem v9, run Deploy-CrmPackage.ps1 with the added argument: -OnPrem.
PS C:\> .\Deploy-CrmPackage.ps1 -OnPrem
4: Provide Dynamics On-Prem Service Credentials
You will need to login for this script to continue, please be sure to check the 'Display list of available organizations' to make sure that you select the correct instance of Dynamics to install to!
Alternatively, the Deploy-CrmPackage.ps1 script also accepts a Dynamics Connection String:
.\Deploy-CrmPackage.ps1 -CrmConnectionString 'AuthType=AD;Url=https://{DYNAMICSURL}.crm.dynamics.com/;Username={DYNAMICSUSERNAME};Password={DYNAMICSPASSWORD}'
This is a sample connection string; with an on-premises install, there are a wide variety of options that may be relevant, depending on your architecture. For more information on connection string formats, refer to Microsoft's available documentation, found here.
Some customers have reported needing to provide a username in the format "domain\username" in order to successfully connect using IFD.
This deployment can take a long time to complete. In most cases it takes around 20 minutes.
Observe that no errors occur while the script is executing.
5: Configure the InRule Solution in Dynamics
Next, we need to configure the deployed Dynamics Solution to point to the on-premises Rule Execution Service. As of InRule version 5.9.0, there are additional options available to support the new Dynamics Execution API and corresponding authentication. This configuration is stepped through in detail in Rules Configuration and Settings.
6: Verify a Successful Deployment!
A Run Rules button will now exist on the edit form of all Dynamics entities. The way this button behaves will depend on other settings that have been configured under the Rule Configuration section; this document assumes the default configuration behavior. To understand what settings are available and what they mean, please see Methods for Executing Rules from Dynamics 365 and Power Platform of this document.
Open up an Account and execute Run Rules. The default deployment is configured to run a Rule App from the catalog named DynamicsRules, which is what we uploaded to the catalog in the Verify Catalog stage. If everything has been set up correctly, you should see the "Rule Execution Completed" message and the description of the account will be updated to provide the date and time.
It is worth noting that the On-Prem plugin will be deployed outside of Sandbox mode. To read more on why this is necessary and the resulting implications, reference Known Issues, Limitations and Troubleshooting.
7: Getting Users Ready
While the parties responsible for deploying out InRule can likely leverage the Run Rules button without issue as they're likely to be system administrators, if your organization intends to empower non-admin users to be able to leverage the Run Rules button, they'll encounter permission issues. This is due to rule execution requiring access to various Dynamics configuration entities that normal users don't generally have permissions to touch.
To circumvent this, the InRule Solution for Dynamics ships with a pre-configured role called the "InRule Rule Executor," which contains the bare minimum permission set necessary for users to be able to make use of the Run Rules button. You'll need to assign any users in your organization to this role if the intent is to empower them to run rules through the Dynamics UI.