Setup D365 Business Events
First off: What are D365 business events?
D365 Business events allow external systems to receive messages from D365 Finance and Operations when certain operations happen within the system.
So for instance, perhaps you need an external system to know when a sales order has been invoiced. Using the built in functionality that business events provides this becomes a lot simpler than if you needed to code a customization.
Lets set one up and see how they work.
Go to System Adminstration > Setup > Business events > Business events catalog
Create an Business Event Endpoint
Before we can setup our event, we need to first setup an ‘Endpoint’ which is where our business event setup will be sent to. Open the Endpoints tab, and click ‘New’
Specify the endpoint type. There are many different types of endpoints that the system supports, including sending the messages to Azure, Microsoft Power Automate, and a custom https endpoint.
For details on setting up an Azure Service Bus Queue, see the Microsoft steps listed here:
https://docs.microsoft.com/en-us/dynamics365/fin-ops-core/dev-itpro/business-events/home-page
In this post, I will go over the steps for setting up an HTTPS endpoint. Select ‘HTTPS’ from the list, and then click ‘Next’.
Configure The Business Event Endpoint
The next form will ask for 5 pieces of information. We will go through each one and how to find their values in the azure portal.
1)Endpoint name: This is the name of the endpoint, and you can specify whatever you wish.
2)Azure active directory application ID
Go to portal.azure.com and sign in. Go to Azure Active Directory, then App registrations.
In the list, select the app that is used by your D365 instance. When the details open, you will see the a value next to the Application (client) ID’. It is this value that you need to use in this field.
3)Azure application secret
This field should be populated with the ‘client secret ID‘ of your Azure active directory application found in the previous step. I do not believe this is a way to lookup this value after creating it. So you need to use the value you wrote down when the Azure app registration record was created.
4)Key Vault DNS Name
If you have not already created a Key vault in Azure, perform the following steps
Create a New Azure Key Vault
- From the Azure portal menu, or from the Home page, select Create a resource.
- In the Search box, enter Key Vault.
- From the results list, choose Key Vault.
- On the Key Vault section, choose Create.
- On the Create key vault section provide the following information:
- Name: A unique name is required.
- Subscription: Choose a subscription.
- Under Resource Group, choose Create new and enter a resource group name.
- In the Location pull-down menu, choose a location.
- Leave the other options to their defaults.
- After providing the information above, select Create.
- Go to the access policy and provide the desired permissions.
- Set the Connectivity method on the ‘Networking’ tab.
- Review settings and click Create.
- Lastly, click on the ‘Overview’ tab of your key value, and copy the value in the ‘DNS Name’ field. This is the value you will enter into the ‘Key Vault DNS Name’ field when setting up the business event endpoint.
5)Key Value Secret Name
If you have not already creating a key value secret, perform the following steps:
Add a Secret to the Azure Key Vault
- From the Key Vault click on the Secrets tile.
- Under Secrets, select Add.
- Under Create a secret, from the list of Upload options, choose an option with which you want to create a secret. Select Manual.
- Enter a Name for the secret. The secret name can contain only alphanumeric characters and the hyphen (-) character. This is the value that you will need to use in the ‘Key vault secret name’ field when setting up the business event endpoint. (This isn’t actually correct. Go back to the details page of your key vault and then look for ‘Vault URI’. Use this value here)
- Enter the https url that you would like the business event message to be sent to, in the Value field of the secret.
- Select Create to start the deployment.
Go back inside the D365 form, and fill out the ‘Configure new Endpoint’ form with the values you have discovered. Then click ‘Ok’ to create the endpoint.
You will now see your endpoint listed on the endpoints tab.
In the next blog, we will cover how to active a business event and have it send to the endpoint we just created.
Wow, this article is nice, my siste is analyzing such things, soo I am going too inform her.
Great looking website. Asshme you did a great deal of your
very owwn coding.
With thanks for sharing your superb website!
Great Article, I was trying to configure the same but I keep getting this error:
Unable to construct endpoint. Exception message: Missing parameter to construct BusinessEventsHttpAdapter. Parameter name: ‘httpUrl’
Any idea what this error means.
Thanks!
I have the same issue, how did you solve it?
Add a new access policy to your key vault that grants Secret – Get, List permission to your application (search by its name in ‘Principal’ tab). That’s what solved this error for me.