Contact Free trial Login

Microsoft Dynamics 365 - Studio Configuration - Mule 4

To configure a connector in Anypoint Studio:

  1. Install the connector

  2. Configure the connector

  3. Configure an input source for the connector

Add the Connector to Your Project

Anypoint Studio provides two ways to add the connector to your Studio project: from the Exchange button in the taskbar or from the Mule Palette.

Add the Connector Using Exchange

  1. In Studio, create a Mule Project.

  2. Click the Exchange (X) icon in the upper left of the Studio task bar.

  3. In Exchange, click Login and supply your Anypoint Platform username and password.

  4. In Exchange, search for Microsoft Dynamics 365.

  5. Select the connector, click Add to project.

  6. Follow the prompts to install the Microsoft Dynamics 365 Connector.

Add the Connector in Studio

  1. In Studio, create a Mule Project.

  2. In the Mule Palette, click (X) Search in Exchange.

  3. In Add Modules to Project, type Microsoft Dynamics 365 in the search field.

  4. Click the Microsoft Dynamics 365 Connector name in Available modules.

  5. Click Add.

  6. Click Finish.

Configure an Input Source

Configure an input source trigger for the connector using On modified object or On new object. When a new or modified object occurs in the Microsoft Dynamics 365 operation, an input source is sent to the connector app.

See Trigger Required Fields to configure the input source operations.

Alternatively, you can also trigger a connector app by listening for HTTP requests or at timed intervals using Scheduler.

Configure the Connector

Create a new Mule project using the Anypoint Studio visual editor:

  1. In Anypoint Studio, click File > New > Mule Project.

  2. Specify a Project Name and click Finish.

  3. Search for "http" and drag the HTTP connector to the canvas.

  4. Click the green plus sign (+) next to Connector Configuration, and click OK in the menu to accept the default values.

  5. Search for "365" and drag the Microsoft Dynamics 365 connector to the canvas. Click the green plus sign (+) next to Connector Configuration and specify your access credentials.

  6. Click a connection strategy for authentication:

    • Microsoft Dynamics 365 OAuth 2.0 Connection

    • Microsoft Dynamics 365 OAuth 2.0 Username-Password

Configure OAuth 2.0 Connection

This configuration provides access to the Microsoft Dynamics 365 Web API.

Configure OAuth 2.0 Username-Password

  1. Click the green plus sign (+) to the right of Connector Configuration.

  2. Provide the following credentials to enable access to your Microsoft Dynamics 365 server:

    • General tab:

      Field Description

      Client ID

      The application ID assigned to your app when you registered it with Azure Active Directory. You can find this in the Azure Portal. Click Active Directory, click the directory, choose the application, and click Configure.

      Client Secret

      The application secret that you created in the app registration portal for your app. This should not be used in a native app, because client secrets cannot be reliably stored on devices. This is required for web apps and web APIs, which have the ability to store the client secret securely on the server side.

      Username

      User name used to initialize the session

      Password

      Password used to authenticate the user

      Resource

      The application ID URI of the web API (secured resource). This must be the root URI, without specifing the CRM version: for example, https://YOUR_ORG.crm.dynamics.com/.

      Token Request Endpoint

      The token endpoint that is called to get the access token: for example, https://login.windows.net/TENANT_ID/oauth2/token, where TENANT_ID is the Azure Active Directory ID.

    • Advanced tab:

      Field Description

      Read Timeout

      The duration in milliseconds that the consumer waits for a response before timing out. Zero (0) means wait forever.

      Connection Timeout

      The duration in milliseconds that the consumer tries to establish a connection before timing out. Zero (0) means wait forever.

  3. Click Test Connection to ensure that your credentials are accepted at the server endpoint.

  4. If present, click Enable DataSense to let your application acquire metadata from the server.

Run a Flow

  1. In Package Explorer, right-click your project’s name and click Run As > Mule Application.

  2. Check the console to see when the application starts. You should see messages such as these if no errors occur:

************************************************************
INFO  2019-10-14 22:12:42,003 [main] org.mule.module.launcher.DeploymentDirectoryWatcher:
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+ Mule is up and kicking (every 5000ms)                    +
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
INFO  2019-10-14 22:12:42,006 [main] org.mule.module.launcher.StartupSummaryDeploymentListener:
**********************************************************
*  - - + DOMAIN + - -               * - - + STATUS + - - *
**********************************************************
* default                           * DEPLOYED           *
**********************************************************

************************************************************************
* - - + APPLICATION + - -   * - - + DOMAIN + - -  * - - + STATUS + - - *
************************************************************************
* myapp                     * default             * DEPLOYED           *
************************************************************************

Next Step

After configuring the Microsoft Dynamics 365 Connector for use in Studio, see the Examples topic for more configuration information.