Skip to main content

Dynamics 365 Rules Configuration and Settings

The Rules Configuration page contains 3 sections: Rule Execution Services Configuration, Step Registration Configuration, and Rule Configurations. Each section will be explored in detail throughout this appendix. The following configuration is required to establish connectivity to the rule execution service and mapping of entity events and triggers to Rule Apps and Rule Sets.

Configure InRule for Microsoft Dynamics 365 page with the Rule Execution Service Configuration, Step Registration Configuration, and Rule Configurations sections

Within Dynamics 365, click on the settings cog in the top right and go to Advanced Settings. From the settings navigation pane, select Rules Configuration under the InRule group.

Dynamics 365 Settings menu opened from the settings cog with Advanced Settings highlighted

Settings navigation pane with Rules Configuration highlighted under the InRule group

Within Power Platform Admin Center, go to the Settings for your environment and then click on All legacy settings. From the settings navigation pane, select Rules Configuration under the InRule section.

Power Platform Admin Center environment Settings page with the All legacy settings link underlined under Resources

Rule Execution Services Configuration​

As of InRule version 5.9.0, the rule execution service is now available via a REST endpoint as compared to the Azure Relay/Webjob integration model used in prior versions. Since both the Dynamics Execution API and the webjob are functionally identical, the transition is relatively seamless, but new authentication options are available and will need to be updated.

REST Endpoint​

Configure the URL for the Dynamics Execution Service along with authentication credentials.

Configuration Form FieldsAdditional details on these settings are found in "Rule Execution App Service for Dynamics 365" section.
Rule Execution Service URLThe URL to the Dynamics execution service that was deployed in self-hosted Azure or InRule SaaS. For InRule SaaS, the URL can be retrieved from the portal in Settings (gear icon) – Provisioned Resources.
Authorization TypeThis drop-down allows you to choose the form of authorization to the Execution Service. You have the option to choose from API Key or OAuth. For OAuth authentication in InRule SaaS, additional setup from InRule Support may be required. Currently OAuth support is limited to either Microsoft Entra or Auth0.
API KeyThe API Key configured for the Dynamics execution service. Either the Primary or Secondary API Key is valid. For InRule SaaS, the API Key can be retrieved from Settings (gear icon) – Configuration.
OAuth Token EndpointToken Endpoint for the Entra or Auth0 Application. E.g., https://login.microsoftonline.com/{yourtenantid}/oauth2/v2.0/token.
OAuth Client IDClient ID for the Entra or Auth0 Application.
OAuth Client SecretClient Secret for the Entra or Auth0 Application.
OAuth Scope(Entra only) Can use the default scope for the Entra Application.
OAuth Audience(Auth0 only) Use the Audience defined for the Auth0 Application.

The following screenshots show the Rule Execution Service Endpoint Configuration using the REST Endpoint with either API Key or OAuth authentication.

API Key

Rule Execution Service Configuration with Execution Service Endpoint set to REST Endpoint, a Rule Execution Service URL, Authorization Type API Key, and a masked API Key

OAuth

Rule Execution Service Configuration with Execution Service Endpoint set to REST Endpoint, Authorization Type OAuth, and Token Endpoint, Client ID, Client Secret, Scope, and Audience fields

Be sure to click the Save button, and to observe the "Saved Changes" notice:

Save and Test buttons with a Saved changes notice

Once changes have been saved, configuration can be tested by clicking the Test button. This test configuration tests these three things:

Test results showing Test Execution Service Connection, Test Execution Service to Dynamics Connection, and Test Rule Catalog Connection, each with Success

  1. Execution Service Connection. Test sends a request to the execution service that was deployed and configured to make sure that it is setup correctly.
  2. Execution Service to Dynamics Connection. Test makes a request from the execution service to make sure that it can make a request back to Dynamics with the connection information configured on the App Service.
  3. Rule Catalog Connection. Test makes a request to the Rule Catalog with the connection information configured on the App Service.

If all the tests succeed, the system has been configured correctly. If any of the tests fail, check the configurations for the subject under test.

Azure Relay​

The Azure Relay will still be supported for a period of time to allow for transition to the new REST Execution API. To enable this, select 'Azure Relay' in the Execution Service Endpoint picklist. This configuration requires the Relay Namespace and the Relay Key (SAS Key) to be available for this step.

Configuration Form FieldsDetails on these settings are found in "Rule Execution App Service for Dynamics 365" section.
Endpoint NameFor basic configuration, this can be left as is.
SAS Key NameThe key output by the ARM template is the 'RootManageSharedAccessKey' key, so this value can be left as the default in most scenarios.
SAS KeyThis is the key secret value, and is output by the ARM template after completion of the deployment. If you did not get the value during deployment, you can find it using the steps in Locate SAS Key in Azure Portal

Note: If you provided the "SasKey" parameter in Step 2 of the Dynamics Solution installation section, this value will already be set.
Azure SB Namespace AddressChange the Relay namespace here, as the default value of 'inrule-crmonline' will not work for you. The relay namespace is the same value provided for the relay name in the ARM template parameters file.

Using the Relay Namespace and the Relay Path, construct the address as follows: https://<<RelayNamespace>>.servicebus.windows.net/<<SB Relay Path>>

Note: If you provided the "SasName" parameter in Step 2 of the Dynamics Solution installation section, this value will already be set.
SB Relay PathUnless you have changed the corresponding setting in rule execution app service, this value can be left as the default, which is 'ruleexecution'

The following screenshots show the Service Endpoint Configuration screen before and after configuration.

  • [#1 in screenshot] SAS Key Name
  • [#3 in screenshot] SAS Key
  • [#4 in screenshot] Azure SB Namespace Address
  • [#5 in screenshot] SB Relay Path

Please note that you must click on Change [#2 in screenshot] before the SAS Key can be entered.

note

If you are using the standard Azure US environment 'AzureCloud', then the provided domain suffix will work fine. However, if you are using an alternate Azure Environment such as US Government or an international environment, be sure to update the suffix to the appropriate value for your region.

Azure Relay Rule Execution Service Configuration before configuration, with numbered callouts 1 through 7 on SAS Key Name, the Change button, SAS Key, Azure SB Namespace Address, SB Relay Path, Save, and Test

Azure Relay Rule Execution Service Configuration after entering a SAS Key, with the Change button replaced by Cancel and the same numbered callouts

Step Registration Configuration​

The Step Registration Configuration section enables the association of Rule Configuration records to entity Create/Update events or the inrule_RulesEngineAction custom action. This is used to map specific Rule Apps, Rule Sets, parameters, and options to an entity event or the Run Rules button.

The InRule Solution contains a default Step Registration after install that points to a Default Rule Configuration. This can be used without modification for basic testing of the Run Rules button. For more advanced execution scenarios, additional Steps and Rule Configurations will need to be added, which are described in the following section.

Step Registration Configuration section showing the InRule Custom Action Step with SDK Message inrule_RulesEngineAction and Rules Configuration for Step set to Default