Using Anypoint Studio to Configure Microsoft Dynamics 365 for Finance and Operations Connector 3.1 | MuleSoft Documentation
# Using Anypoint Studio to Configure Microsoft Dynamics 365 for Finance and Operations Connector 3.1
Anypoint Studio (Studio) editors help you design and update your Mule applications, properties, and configuration files.
To add and configure a connector in Studio:
  1. Create a Mule project.
  2. Add the connector to your Mule project.
  3. Configure an input source for the connector’s flow.
  4. Add a connector operation to the flow.
  5. Configure a global element for the connector.


If you are new to configuring connectors in Studio, see Using Anypoint Studio to Configure a Connector. If, after reading this topic, you need additional information about the connector fields, see Microsoft Dynamics 365 for Finance and Operations Reference.
## Create a Mule Project
In Studio, create a new Mule project in which to add and configure the connector:
  1. In Studio, select **File > New > Mule Project**.
  2. Enter a name for your Mule project and click **Finish**.


## Add the Connector to Your Mule Project
Add Anypoint Connector for Microsoft Dynamics 365 for Finance and Operations (Microsoft Dynamics 365 for Operations Connector) to your Mule project to automatically populate the XML code with the connector’s namespace and schema location and add the required dependencies to the project’s `pom.xml` file:
  1. In the **Mule Palette** view, click **(X) Search in Exchange**.
  2. In **Add Dependencies to Project** , type `dynamics finance` in the search field.
  3. Click the connector name in **Available modules**.
  4. Click **Add**.
  5. Click **Finish**.


Adding a connector to a Mule project in Studio does not make that connector available to other projects in your Studio workspace.
## Configure a Source
A source initiates a flow when a specified condition is met. You can configure one of these sources to use with Microsoft Dynamics 365 for Operations Connector:
  * `HTTP Listener` Initiates a flow each time it receives a request on the configured host and port
  * `Scheduler`+ Initiates a flow when a time-based condition is met


For example, to configure HTTP Listener, follow these steps:
  1. In the **Mule Palette** view, select **HTTP > Listener**.
  2. Drag **Listener** to the Studio canvas.
  3. On the **Listener** configuration screen, optionally change the value of the **Display Name** field.
  4. Specify a value for the **Path** field.
  5. Click the plus sign (+) next to the **Connector configuration** field to configure a global element that can be used by all instances of the HTTP Listener in the app.
  6. On the **General** tab, specify connection information.
  7. On the **TLS** tab, optionally specify TLS information.
  8. On the **Advanced** tab, optionally specify reconnection information, including a reconnection strategy.
  9. Click **Test Connection** to confirm that Mule can connect with the specific server.
  10. Click **OK**.


## Add a Connector Operation to the Flow
When you add a connector operation to your flow, you immediately define a specific operation for that connector to perform.
To add an operation for Microsoft Dynamics 365 for Operations Connector, follow these steps:
  1. In the **Mule Palette** view, select **Dynamics 365 for Operations** and then select the desired operation.
  2. Drag the operation onto the Studio canvas and to the right of the input source.


## Configure a Global Element for the Connector
When you configure a connector, it’s best to configure a global element that all instances of that connector in the app can use. Configuring a global element requires you to provide the authentication credentials the connector uses to access the target Microsoft Dynamics 365 system. Microsoft Dynamics 365 for Operations Connector supports OAuth 2.0 authentication.
To configure the global element for Microsoft Dynamics 365 for Operations Connector, follow these steps:
  1. Select the name of the connector in the Studio canvas.
  2. In the configuration screen for the operation, click the plus sign (**+**) next to the **Connector configuration** field to access the global element configuration fields.
  3. On the **General** tab, in **Connection** , select the authentication method to configure:
     * **OAuth Client Credentials**
     * You can reference a configuration file that contains ANT-style property placeholders (recommended), or you can enter your authorization credentials in the global configuration properties. For information about the benefits of using property placeholders and how to configure them, see Anypoint Connector Configuration.
  4. On the **Advanced** tab, optionally specify reconnection information, including a reconnection strategy.
  5. Click **Test Connection** to confirm that Mule can connect with the specified server.
  6. Click **OK**.


### OAuth Client Credentials
Enter the following required information on the **General** tab of the **Global Element Properties** screen to configure **OAuth Client Credentials** authentication:
Field | Description  
---|---  
App ID URI of the web API  
OAuth client ID as registered with the service provider  
**Client Secret** |  OAuth client secret as registered with the service provider  
### OAuth 2.0
Use OAuth 2.0 to delegate user authentication to the service hosting the user account. For more information, refer to Configuring OAuth 2.0 for Connectors or Configuring OAuth 2.0 for Connectors on CloudHub.
Enter the following information on the **General** tab of the **Global Element Properties** screen to configure **OAuth 2.0** authentication:
Field | Description  
---|---  
The OAuth endpoint URL.  
**Consumer Key** |  The app ID assigned to your app when you registered it with Azure Active Directory. You can find this in the Azure Portal (portal.azure.com). Click **Active Directory** , click the directory, choose the app, and click **Configure**.  
**Consumer Secret** |  The secret that you created in the app registration portal for your app. Do not use this in a native app because client secrets cannot be reliably stored on devices. The client secret is required for web apps and web APIs, which have the ability to store the client secret securely on the server side. You can find this in the Azure Portal (portal.azure.com). A client secret is a numerical value known only to your app and the Azure server, which enables access for your app.  
**Authorization URL** |  Tenant-specific OAuth2.0 endpoint in the format: `https://login.microsoftonline.com/{tenant}/oauth2/authorize` (follow instructions presented in the previous link for specific information on how to obtain the endpoint).  
**Access token URL** |  Tenant-specific endpoint for requesting the access token in the format: `https://login.microsoftonline.com/{tenant}/oauth2/token` (follow instructions presented in the previous link for specific information on how to obtain the endpoint).  
**Listener config** |  Name of the HTTP Listener instance created in the Anypoint Studio flow.  
**Callback path** |  The URL to which authentication responses can be sent and received by your app.  
**Authorize path** |  The URL that triggers the OAuth mechanism.  
**External callback URL** |  Required only if the callback URL is not accessible directly, for example, when using proxies. The callback path uses this format: `http://localhost:8081/callback`  
+ image::microsoft-365-ops-as-oauth2.png["Microsoft Dynamics for Finance and Operations Connector OAuth 2.0 configuration fields"]
## See Also
  * Introduction to Anypoint Connectors
  * Using Anypoint Studio to Configure a Connector
  * Microsoft Dynamics 365 for Finance and Operations Connector Reference
  * MuleSoft Help Center