# Microsoft Dynamics 365

Microsoft Dynamics 365 (opens new window) is a customer relationship management software package developed by Microsoft. It is built on the Microsoft Dynamics 365 platform, allowing users to easily extend and tailor the application for their business.

# API version

The Microsoft Dynamics 365 connector uses the Microsoft Dynamics 365 API v8.0 and v9.0. Select your preferred version during connection.

# How to connect to Microsoft Dynamics 365 on Workato

Connection setup Connection setup

Field Description
Connection name Give this connection a descriptive name to indicate which Dynamics 365 instance it is connected to.
Subdomain The subdomain of your Dynamics 365 instance.
Account type Indicate if you are connecting to a cloud instance or an on-premise instance.
AD domain Name
Only for on-premise instance
The Active Directory server.
Client ID The client ID.
Client secret The client secret.

Find out how to create a connection to your Microsoft Dynamics 365 instance, through the cloud app or through the on-premise application.

# Connecting to a cloud Microsoft Dynamics 365 instance

In order to connect to Microsoft 365 Dynamics on Workato, you need to obtain a client ID by registering your Microsoft 365 Dynamics app with Azure Active Directory. We walk through the process of registering Microsoft 365 Dynamics below.

  1. Sign in to the Microsoft Azure management portal by using an account with administrator permission. You must use an account in the same Office 365 subscription (tenant) as you intend to register the app with.

Azure Homepage Microsoft Azure homepage

  1. Click App registrations.

App Registration App registrations is located on the navigation menu on the left

  1. If you already have an application, use that ID. If not, proceed to click Add. Provide a name for the application to add (typically "Workato"). Choose the account type as "Accounts in this organizational directory only (Single tenant)" and provide a redirect URI value of https://www.workato.com/oauth/callback. Click Register in the bottom of the page.

Add application Register the application

  1. Your new application will be displayed on your app registrations. Select your new app to open the app details.

Add Select the newly created application

  1. In your app details page, create a Client Secret under the Certificates & Secrets section. This will be required for the connection setup.

New client secret Create client secret

  1. In the right menu click API permissions > Add a permission.

Required permissions Click Required permissions

  1. Select Dynamics 365 from the Microsoft API tab.

Dynamics CRM Select Dynamics 365 Online API access

  1. Select Delegated permission, then check the user_impersonation checkbox. Select Add permissions.

Add permissions Add permissions

  1. Retrieve the application (client) ID as the client ID to connect to Workato.

Application ID Retrieve the Application ID

  1. Retrieve the Client secret to connect to Workato.

Retrieve client secret Retrieve client secret

  1. Extend the refresh token expiration time if required.

# Connecting to an on-premise Microsoft Dynamics 365 instance

In order to connect to Microsoft 365 Dynamics on Workato, you need to obtain a client ID by registering Microsoft 365 Dynamics App with Active Directory Federation Service. Click here (opens new window) to read more on how to register an on-premise Dynamics app with Active Directory Federation Service.

Remember to extend the refresh token expiration time if required.

# Extending refresh token expiration time

Whenever you connect to a Dynamics app, Workato gets an access token to be able to read and write to your Dynamics instance. This access token is valid until its expiry date. Workato also gets an accompanying refresh token with this access token. Whenever your access token expires, Workato can request for a new access token with the refresh token. Dynamics will check that this refresh token is still valid (i.e. the token has not been revoked), and provide a new pair of access and refresh tokens.

However, refresh tokens have expiry dates as well. If both access token and refresh token expires before Workato requests for new tokens, the Dynamics connection will no longer be valid, and a re-connection is required from the user. When this happens, Workato's requests to Dynamics will get a 400 response. If you are using a Dynamics 365 trigger, this results in your recipe experiencing trigger errors. If you are using a Dynamics CRM action, this results in job errors.

To ensure your recipes run continuously without requiring intervention, extend your refresh token expiration time, or set it to unlimited. You can apply and scope it to an OAuth application instead of applying it to the entire organization.

Read more about token lifetimes in the Microsoft documentation (opens new window).

Last updated: 5/17/2024, 2:35:03 AM