# How to Set Up Your MS Dynamics Integration

{% hint style="info" %}
We will walk through the process of creating a new app in the Microsoft Dynamics ecosystem. Microsoft will likely make changes to this at some point, so please be aware the UIs may look different.
{% endhint %}

## Create a new App in Azure

* Navigate to <https://portal.azure.com>
* Click "Microsoft Entra ID"
* Navigate to "App registrations"
* Click "New registration"
* Enter a memorable Name such as "FeedOtter Integration"
  * Leave all other fields default
  * Click **Register**
* For the following page, you will need the these items:
  * **Application (client) ID**
  * Copy this to a notepad so you can paste it into FeedOtter later in this process.
* From the left side menu click on **API permissions**
  * Add a permission
  * Select "Dynamics CRM"
  * Check the box next to *user\_impersonation*
  * Click **Add permission**
* From the left sidebar, click on **Certificates & Secrets**
  * Click on **New client secret**
  * Give it a memorable description value such as "FeedOtter Integration Secret"
  * We recommend setting the expires value as long as you possibly can tolerate.
  * Copy the VALUE from the newly created secret. Paste it in the same place you stored the clientId value earlier. (NOT the Secret Id!)

## Add API permissions in Power Apps

* Navigate to <https://admin.powerplatform.microsoft.com/environments>
* Navigate to the appropriate environment for your Dynamics instance
* Go to **Settings**
* Under **Users & permissions** select Application users
* Click **New app user**
* Select the "FeedOtter" app user you created in the previous Azure step
* Select the business unit you wish to use
* For the Security Role, we know the integration will work with the "System Administrator" role.  Obviously this is not ideal so please select an appropriate role that has read/write access to the following tables:

  ```php
  msdynmkt_email (required)
  msdyncrm_marketingemail (optional)
  ```

## Setup your connection in FeedOtter

* Navigate to <https://app.feedotter.com/account/connections>
* Click **Add integration**
* Select MS Dynamics
* Using the clientId and secret obtained from the steps above, fill out the input boxes.
  * Resource - this is the base url used for your Dynamics instance. It typically will look something like this:  *<https://org0ab02413.crm.dynamics.com>*
  * Client Id and Client Secret should be filled with the values obtained earlier.
  * Click **Save**

{% hint style="info" %}
FeedOtter will attempt to verify your connection's validity.  If it succeeds, you are ready to test pushing an email to Dynamics.
{% endhint %}

At this point you are ready to set up your RSS and/or curated newsletters using the following tutorials:

* [getting-started](https://docs.feedotter.com/curated-newsletters/getting-started "mention") (Curated Newsletters)
