Integrate the ServiceNow instance and Microsoft Dynamics 365 for Finance and Operations by creating a custom OAuth application in Microsoft Azure to authenticate ServiceNow requests.

Before you begin

  • Request an Integration Hub subscription.
  • Activate Microsoft Dynamics 365 for Finance and Operations spoke.
  • Role required: admin
Note: After configuring the connection and credential alias, make sure to retrieve the latest metadata from Microsoft Dynamics 365 Finance and Operations application.

Register Microsoft Dynamics 365 for Finance and Operations as an OAuth provider

Register Microsoft Dynamics 365 for Finance and Operations as the OAuth provider so that the ServiceNow instance can request OAuth 2.0 tokens.

Before you begin

Role required: admin

Procedure

  1. Navigate to All > System OAuth > Application Registry.
  2. Open for the record for Microsoft D365 Fin and Ops Spoke OAuth.
  3. On the form, fill these values.
  4. Right-click the form header, and click Save.

Create a connection record for the Microsoft Dynamics 365 for Finance and Operations

Create a connection record for your Microsoft Dynamics 365 for Finance and Operations. The Microsoft Dynamics 365 for Finance and Operations spoke connection and credential aliases use these connections to perform actions in Microsoft Dynamics 365 for Finance and Operations.

  1. Navigate to All > Connections & Credentials > Connections & Credentials Aliases.
  2. Open the alias record for MicrosoftD365FinAndOps.
  3. From the Connections tab, click New.
  4. On the form, fill these fields.
  5. Click Submit.

Retrieve metadata from Microsoft Dynamics 365 Finance and Operations

Retrieve the metadata from Microsoft Dynamics 365 Finance and Operations and store it in your ServiceNow instance. Dynamic actions require the latest metadata from Microsoft Dynamics 365 Finance and Operations.

Before you begin

Role required: admin.

Procedure

  1. Navigate to All > Microsoft D365 FinOps Metadata > Microsoft D365 FinOps Metadata Content.
  2. Click Get/Refresh Metadata.
  3. Select the alias to retrieve updated metadata from Microsoft Dynamics 365 Finance and Operation application and click Ok.
    Note: Make sure to retrieve the latest metadata whenever there any changes in the Microsoft Dynamics 365 Finance and Operations application.

Set up bi-directional webhook for the Microsoft Dynamics 365 for Finance and Operations Spoke

Configure webhook to subscribe to Microsoft Dynamics 365 for Finance and Operations Spoke with a ServiceNow callback URL.

Before you begin

Role required: admin

Procedure

  1. Navigate to All > Microsoft D365 FnO spoke > FnO Webhook Registries.
  2. Click New.
  3. On the form fill in the fields.

Customize bi-directional webhook in the Microsoft Dynamics 365 Finance and Operations spoke

Create webhook routing policy and subflow as per your requirement in the Microsoft Dynamics 365 Finance and Operations spoke.

Before you begin

Role required: admin

Procedure

  1. Navigate to All > Flow Designer > Designer.
  2. Click Subflows.
  3. Create a copy of the required subflow.
  4. Customize the required subflow as per your requirement and publish it.
  5. Navigate to Microsoft D365 FnO Spoke > FnO WebHook Routing Policies.
  6. Click New.
  7. On the form, fill in the fields.
  8. Click Submit.
    Note: These routing policies are saved in the Decision tables. Users are cautioned against directly updating or modifying data in these tables.

Result

Routing policy and subflow are created.

Register an app in Microsoft Azure portal for Microsoft Dynamics 365 Finance and Operations spoke

Register your ServiceNow instance in Microsoft Azure portal in order to use Microsoft Dynamics 365 Finance and Operations spoke.

Before you begin

Role required: admin

Procedure

  1. Log in to Azure portal.
  2. Navigate to App registrations and register an app for the webhook.
  3. Create a key vault using the Azure portal.
  4. Navigate to Access policies.
  5. Create an access policy.
  6. Select Get under Secret permissions and click Next.
  7. In the Principal tab, search for the name of the app registered earlier and click Next.
  8. In the Application (optional) tab, click Next.
  9. In the Review + create tab, click Create.
  10. Navigate to Secrets section.
  11. Click on + Generate/Import.
  12. On the Create a secret page, enter a name and provide the callback URL generated from your ServiceNow instance.
  13. Click Create.
  14. Log in to your Microsoft Dynamics 365 Finance and Operations portal.
  15. Navigate to System administration > Business events > Business events catalog.
  16. Navigate to the Endpoints tab and click New.
  17. Select the endpoint type as HTTPS from the Standard view and click Next.
  18. On the form, fill in the details.
  19. Click Ok.
    Note: Ensure that key vault access policy is created for the application. The access policy should allow the application registry to access secrets from the key vault.
  20. Navigate to the Business Events tab and search for a category.
    For example, Purchase orders.
  21. Select the required category from the list and click Activate.
  22. In the Configure new business event section, select the legal entity and endpoint name.
  23. Click Ok.
    Note: Ensure that these API permissions are enabled for the application.
    • Access Dynamics AX Custom Service
    • Access Dynamics AX data
    • Access Dynamics AX online as organization users

Result

The webhook is registered and ready for testing.