Skip to main content

Dynamics 365 Azure App Service Plan and Application Insights Configuration

Azure App Service Plan Overview​

The Dynamics Rule Execution Azure App Service runs on an Azure App Service Plan. The ARM Template deployment process, outlined in Rule Execution App Service for Dynamics 365 will require you to provide an appInsightsConnectionString and set the connection string.

This App Service Plan will be deployed to the subscription and resource group provided during the deployment process. Additionally, the plan will be configured with a "B1" (Basic, Small) pricing tier. This is the lowest tier possible for the Rule Execution App Service to run in, as it is the lowest tier that allows running in Always On mode. Always On is required to permit a continuous web job to run on the app service. Thus, regardless of whether or not you opt to allow the ARM template to create an App Service Plan for you, or use a pre-existing one, the plan must, at a minimum, be of the "B1" tier or higher.

warning

If you leave the ARM template configured to re-deploy the App Service Plan, updating an existing one, the pricing tier of that App Service Plan will be set to the default pricing tier, regardless of what it may currently be set to. If you do not wish the pricing tier to be reverted to default, it is recommended you follow the steps below.

Should you wish to use a pre-existing Azure App Service Plan rather than have a new one created for you, a few configuration steps within the ARM template itself are necessary.

Configuring the ARM Template to Use an Existing Azure App Service Plan​

1: Locate InRule.Dynamics.Service.parameters.json​

The ARM template parameters file is located in the RuleExecutionAzureService folder as, defined in Rule Execution App Service for Dynamics 365

Windows File Explorer showing the RuleExecutionAzureService folder of the InRule for Microsoft Dynamics CRM Integration Framework with azuredeploy.json, azuredeploy.parameters.json, InRule.Crm.WebJob.zip, and Register-AzureApp.ps1

2: Populate "appServicePlanName" Parameter​

Open the file in your text editor of choice. First, populate the "appServicePlanName" parameter at the bottom of the parameters file. Set the value equal to the name of your app service plan.

    },
"appServicePlanName": {
"value": "yourAppServicePlanName"
}
}
}

3: Update "createOrUpdateAppServicePlan" Parameter​

Next, you'll need to set the parameter called "createOrUpdateAppServicePlan" to false.

    },
"appServicePlanName": {
"value": "yourAppServicePlanName"
},
"createOrUpdateAppServicePlan": {
"value": false
}
}
}

4: [Optional] Create "servicePlanResourceGroupName" Parameter​

In the event the App Service Plan you intend to use is located in a different resource group than the one you are deploying the ARM template against, you need to add a parameter to inform the ARM template what resource group your App Service Plan is in. Create the "servicePlanResourceGroupName" parameter as shown below and define the value as the name of the resource group your App Service Plan exists in.

    },
"createOrUpdateAppServicePlan": {
"value": false
},
"servicePlanResourceGroupName": {
"value": "yourResourceGroupName"
}
}
}

5: Save InRule.Dynamics.Service.parameters.json and Continue Deployment​

Save and close the file. You can now proceed with the deployment process outlined in Rule Execution App Service for Dynamics 365 as normal; your rule execution app service will now deploy to the App Service Plan you defined in the steps above.

Azure Application Insights Overview​

For improved logging capabilities, the Dynamics Rule Execution Service is configured to use an Azure App Insights resource as a logging sink in addition to the logging the App Service itself already has. An App Insights connection string can be provided in the ARM Template deployment parameters to log to an existing App Insights resource as outlined in Rule Execution App Service for Dynamics 365.

The app insights resource will aggregate all the logs generated from the execution service. These logs can be tremendously useful for debugging any issues encountered with the Rule Execution Service. Depending on the level of event logging configured for the Rule Execution Service Event Log, these logs can add insight into rule executions, entity loading, overall execution timing, and any errors encountered during rule execution.