Set up the Microsoft Dynamics 365 for Finance and Operations spoke
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 the 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
Navigate to All > System OAuth > Application Registry.
Open for the record for Microsoft D365 Fin and Ops Spoke OAuth.
On the form, fill these values.
Field
Description
Name
Name to uniquely identify the record. For example, enter: `Microsoft Dynamics 365 for Finance and Operations OAuth`
Client ID
Client ID created during the Microsoft Dynamics 365 for Finance and Operations application configuration.
Client Secret
Client Secret created during the Microsoft Dynamics 365 for Finance and Operations application configuration.
OAuth server token endpoint. Enter: `https://login.microsoftonline.com//oauth2/v2.0/token`
Token Revocation URL
OAuth server token revocation endpoint.
Redirect URL
OAuth callback endpoint in this format: `https://.service-now.com/oauth_redirect.do`
OAuth API Script
Script to customize the request and response. Select ****.
Logo URL
URL that contains an image to use as the application logo.
Default Grant Type
Grant type used to establish the token. Select Client Credentials.
Refresh Token Lifespan
Time, in seconds, that the refresh token is valid. The default time is 8,640,0000 seconds.
PKCE required
Option to enable public clients to require PKCE for an authorization.Note: You can use only Authorization Code as the Default Grant type when PKCE is enabled.
Application
Application scope that contains this record.
Accessible from
Application scope that this registry is accessible from.
Active
Option to actively use the application registry.
Use mutual authentication
Option to use mutual authentication for token request and revocation. This option requires a mutual authentication profile to be specified.
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.
Before you begin
Role required: Admin
Procedure
Navigate to All > Connections & Credentials > Connections & Credentials Aliases.
Open the alias record for MicrosoftD365FinAndOps.
From the Connections tab, click New.
On the form, fill these fields.
Field
Description
Name
Name to uniquely identify the record. For example, Microsoft Dynamics 365 for Finance and Operations Connection.
Credential
Credential record created for Microsoft Dynamics 365 for Finance and Operations. Search and select MicrosoftD365FinAndOps.Credential.
Connection alias
Alias record associated with this connection. Enter sn_ms_fin_ops_spk.MicrosoftD365FinAndOps
Connection URL
Base URL to connect to Microsoft Dynamics 365 for Finance and Operations. Enter: https://<instance_ID>.cloudax.dynamics.com/
Active
Option to actively use the connection record.
Domain
Domain that the action runs in.
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
Navigate to All > Microsoft D365 FinOps Metadata > Microsoft D365 FinOps Metadata Content.
Click Get/Refresh Metadata.
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
Navigate to All > Microsoft D365 FnO spoke > FnO Webhook Registries.
Click New.
On the form fill in the fields.
Field
Description
Name
Unique name for the webhook registry. For example, `Microsoft Dynamics 365 for Finance and Operations webhook`.
Description
Optional description for the webhook.
Generate Callback URL
Option to generate a callback URL which is used to register the webhook in the Microsoft Dynamics 365 Finance and Operations portal.
Generate New Secret
Option to generate a secret key for Microsoft Dynamics 365 Finance and Operations webhook.Note:
When you generate a new secret, ensure that you generate the callback URL also after generating the secret.
Record the callback URL for registering the app in Azure portal.
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
All > Process Automation > Workflow Studio
Click Subflows.
Create a copy of the required subflow.
Customize the required subflow as per your requirement and publish it.
Navigate to Microsoft D365 FnO Spoke > FnO WebHook Routing Policies.
Click New.
On the form, fill in the fields.
Field
Description
Label
Unique label to identify the routing policy.
Default answer
Option to specify if this is the default answer. Default answer is applicable when the conditions are not met.1. Click the Lookup icon. 2. Select the required subflow from the Document: list.
Note: Ensure that the Table name is Flow [sys_hub_flow].
Select Get under Secret permissions and click Next.
In the Principal tab, search for the name of the app registered earlier and click Next.
In the Application (optional) tab, click Next.
In the Review + create tab, click Create.
Navigate to Secrets section.
Click on + Generate/Import.
On the Create a secret page, enter a name and provide the callback URL generated from your ServiceNow instance.
Click Create.
Log in to your Microsoft Dynamics 365 Finance and Operations portal.
Navigate to System administration > Business events > Business events catalog.
Navigate to the Endpoints tab and click New.
Select the endpoint type as HTTPS from the Standard view and click Next.
On the form, fill in the details.
Endpoint name
Name of the endpoint.
Endpoint type
Type of the endpoint.
Key Vault
Key vault created for the application.
Azure Active Directory Application ID
Object ID of the application.
Azure application secret
Secret created for the application
Key vault DNS name
Vault URI of the application.
Key vault secret name
Name of the key vault secret.
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.
Navigate to the Business Events tab and search for a category.
For example, Purchase orders.
Select the required category from the list and click Activate.
In the Configure new business event section, select the legal entity and endpoint name.
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 app is registered in Azure and the webhook endpoint is configured.