How To Setup D365 Business Events Part 1

Share this:

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’

D365 business events endpoints

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.

configure new D365 business events 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.

configure new D365 business events endpoint

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. 

Azure application client ID

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

  1. From the Azure portal menu, or from the Home page, select Create a resource.
  2. In the Search box, enter Key Vault.
  3. From the results list, choose Key Vault.
  4. On the Key Vault section, choose Create.
  5. 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.
  6. After providing the information above, select Create.
  7. Go to the access policy and provide the desired permissions.
Azure add access policy
  1. Set the Connectivity method on the ‘Networking’ tab.
Azure create key vault
  1. Review settings and click Create.
  2. 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

  1. From the Key Vault click on the Secrets tile.
  1. Under Secrets, select Add.
  2. Under Create a secret, from the list of Upload options, choose an option with which you want to create a secret. Select Manual.
  3. 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)
  4. Enter the https url that you would like the business event message to be sent to, in the Value field of the secret.
  5. 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.

D365 business events endpoint

In the next blog, we will cover how to active a business event and have it send to the endpoint we just created.

Peter Ramer
Peter Ramer is a part of the Managed Application Services team at RSM working on Microsoft Dynamics 365. He focuses on the Retail and Commerce industries. When he is not solving problems and finding ways to accelerate his clients' business, he enjoys time with his three kids and amazing wife.

Share this:

6 thoughts on “How To Setup D365 Business Events Part 1

Add yours

  1. 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!

    1. 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.

Leave a Reply

Your email address will not be published. Required fields are marked *

Proudly powered by WordPress | Theme: Baskerville 2 by Anders Noren.

Up ↑