> ## Documentation Index
> Fetch the complete documentation index at: https://docs.brilo.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Connect Microsoft Dynamics 365 Sales

> Connect Dynamics 365 Sales to Brilo so your agent can find callers, create and qualify leads, and log every call with its transcript on the lead.

Connect Microsoft Dynamics 365 Sales to Brilo in about ten minutes. Your agent can then find
callers in Dynamics during the call, create and update leads (including your own custom lead
columns), log every call and save the transcript as a note on the lead, leave follow-up tasks for
your team, and qualify or disqualify leads. Writing to Dynamics runs after the call ends, so the
caller never waits for it.

## Before you start

* A Microsoft admin for about ten minutes. Approving Brilo needs a Global Administrator,
  Application Administrator or Cloud Application Administrator. Adding Brilo to your Sales
  environment needs a Power Platform administrator, a Dynamics 365 administrator, or someone with
  the System Administrator role in that environment. One person often has both. See
  [Step by step for your Microsoft admin](#step-by-step-for-your-microsoft-admin).
* A Dynamics 365 Sales environment. This is where Dynamics keeps leads, contacts and their
  activities. Dynamics 365 Business Central is a different Microsoft product and is not supported.
* A Brilo plan that includes the app store. Logging every call automatically also needs
  automations after a call. See [Plans and what they include](https://docs.brilo.ai/supported/plans.md).
* An agent to give the Dynamics actions to, even an unfinished one.

There is nothing to create in Azure and no key to copy. Brilo has its own app in Microsoft,
called **Brilo for Dynamics**, and you approve it.

## Steps

**1. Open Microsoft Dynamics 365 Sales in the Brilo app store**

In the Brilo dashboard, open **App Store**, choose **Microsoft Dynamics 365 Sales**, click
**Connect**, then **Continue**.

**2. Approve Brilo in Microsoft**

**Continue** takes you to Microsoft. Sign in as your Microsoft admin and click **Accept** to
approve **Brilo for Dynamics** for your organization. Microsoft then sends you back to
Brilo, where the connection window opens again on the next step. Keep that Brilo tab open.
Finish this within ten minutes of clicking **Continue**, in the same browser.

**3. Add Brilo to your Sales environment**

Approving Brilo lets it sign in to your organization, but Dynamics also needs to know which
environment Brilo may open and what it may do there. In a new tab, open
[Power Platform admin center](https://admin.powerplatform.microsoft.com) and go to
**Environments**, then your Sales environment, then **Settings**, then **Users +
permissions**, then **Application users**. Click **New app user**, add **Brilo for Dynamics**,
choose a **Business unit** (your top business unit is usually right), give it the
security role **Salesperson**, and click **Create**. The admin section below has every click.

**4. Copy your Environment URL**

In Power Platform admin center, open **Environments**, then your Sales environment. Copy the
**Environment URL**. It looks like `https://contoso.crm.dynamics.com`.

**5. Paste it, test, then install**

Back in Brilo, paste it into **Environment URL**. **Connection name** is optional and helps
when you connect more than one environment. Click **Test connection**. When the test passes,
click **Install App**.

The **Salesperson** role lets Brilo read and write leads, contacts, phone calls, notes and tasks.
If **Qualify lead** fails with a permissions message, your environment may limit what
salespeople can create from a lead; add the **Sales Manager** role to the Brilo application user,
or ask your Dynamics admin which permission is missing.

## Step by step for your Microsoft admin

Send this section to whoever looks after Microsoft 365 or Dynamics 365 at your company. It has
two parts: approving Brilo for your organization, then adding Brilo to your Sales environment.
Together they take about ten minutes, and neither one needs code, a key or a password shared with
Brilo.

### Who can do it

| Part | Microsoft role that can do it |
| - | - |
| 1. Approve Brilo for your organization | Global Administrator, Application Administrator or Cloud Application Administrator in Microsoft Entra ID |
| 2. Add Brilo to your Sales environment | Power Platform administrator or Dynamics 365 administrator, or the System Administrator security role in that environment |

### Part 1: Approve Brilo for your organization

Approval has to start from Brilo, because that is how Brilo learns which Microsoft organization
belongs to your Brilo workspace. Nobody types your organization's details into Brilo.

**1. Start from Brilo**

Sign in to the Brilo dashboard, open **App Store**, choose **Microsoft Dynamics 365 Sales**,
click **Connect**, then **Continue**. Brilo sends you to a Microsoft sign in page.

**2. Sign in with your admin account**

Sign in to Microsoft with an account that has one of the Part 1 roles above. If Microsoft
says you need an admin or admin approval, the account you signed in with is not an admin: sign out of
Microsoft and sign in again with an admin account.

**3. Review what Brilo asks for, then accept**

Microsoft shows **Brilo for Dynamics** and the permissions it asks for, which include
access to Dynamics 365 for your organization. Approving it adds Brilo to your organization as an
app, so that you can then give it a role in Dynamics in Part 2. Brilo never signs in as any
of your people, and on its own this approval does not open any of your Dynamics data. Click
**Accept**.

**4. Come back to Brilo**

Microsoft sends you back to Brilo, and the connection window opens again asking for your
**Environment URL**. Leave this tab open and do Part 2 in a new tab.

> [!NOTE]
>
> Brilo links the approval to the Brilo user who clicked **Continue**, in that browser, for ten
> minutes. If the person who manages your Brilo workspace is not a Microsoft admin, either invite
> the admin to your Brilo workspace so they click **Continue** themselves, or have the admin sign
> in to Microsoft on the same computer straight after **Continue** is clicked. Forwarding the
> Microsoft page to someone else does not work.

### Part 2: Add Brilo to your Sales environment

**1. Open your environment's application users**

Go to [Power Platform admin center](https://admin.powerplatform.microsoft.com). Open
**Environments** and click the name of the environment where Dynamics 365 Sales keeps your
leads. In the bar at the top, click **Settings**, then under **Users + permissions** click
**Application users**.

**2. Add Brilo**

Click **New app user**, then **Add an app**. Find **Brilo for Dynamics** in the list,
select it, and click **Add**. It only appears after Part 1. If it is missing, Part 1 did not
finish: start it again from Brilo.

**3. Choose a business unit**

Pick the **Business unit** whose leads Brilo should work with. Your top business unit, named
after your organization, covers everyone and is usually right.

**4. Give it the Salesperson role**

Next to **Security roles**, click the edit icon, select **Salesperson**, and save. Salesperson
lets Brilo read and write leads, contacts, phone calls, notes and tasks, which is what the
Brilo actions need. Do not give it System Administrator.

**5. Create the application user**

Click **Create**. **Brilo for Dynamics** now shows in the list of application users for
this environment.

**6. Copy the Environment URL**

Back on **Environments**, open the same environment and copy its **Environment URL**, like
`https://contoso.crm.dynamics.com`. Paste it into the Brilo tab from Part 1, click **Test
connection**, then **Install App**.

If you have more than one Sales environment, such as a test one and a live one, do Part 2 in
the one whose Environment URL you paste into Brilo.

### Check it in Microsoft

* In [Microsoft Entra admin center](https://entra.microsoft.com), open **Enterprise
  applications** (search for it at the top if you do not see it) and search for **Brilo for
  Dynamics**. Its **Permissions** page shows that an admin granted consent for your
  organization.
* In Power Platform admin center, your environment's **Application users** list shows **Brilo for
  Dynamics** with the **Salesperson** role.

To take Brilo's access away later, see
[How do I stop Brilo from accessing Dynamics 365?](#faq) in the FAQ below.

## You will know it worked when

* **Test connection** passes and Brilo says Dynamics 365 is now linked to your workspace.
* Microsoft Dynamics 365 Sales shows as connected in the app store.
* On a test call from a number that is on a lead in Dynamics, your agent uses that lead's first
  name.
* After a test call with the after-call workflow on this page, a phone call and a note appear on
  the lead's timeline in Dynamics.

## What your agent can do in Dynamics 365

Brilo's Dynamics 365 connection gives your agent sixteen actions. Add each one from your agent's
**Actions** tab with **Add Actions**, then **Microsoft Dynamics 365 Sales**. A new Dynamics action runs
after the call by default, which its **Trigger** setting shows as **After the call (post-call)**.
See [What are actions](https://docs.brilo.ai/actions/what-are-actions.md) for how actions work in general.

This table lists each Dynamics 365 action, what it does, and the timing it suits best.

| Dynamics 365 action | What it does | Best timing |
| - | - | - |
| Find lead by phone | Finds the leads whose business, home or mobile number matches the caller's number, however it was typed in Dynamics | During and after the call |
| Find contact by phone | Finds the contacts whose number matches, for callers who are already customers | After the call |
| Search leads | Finds leads by name, company or email | After the call |
| Get lead | Reads one lead's details and status | After the call |
| Create lead | Adds a new lead with a topic, name, company, job title, email, phones and a description | After the call |
| Update lead | Changes those same details on a lead, leaving anything empty as it is | After the call |
| Update lead fields | Sets any lead columns by their Dynamics names, including your own custom columns, such as a loan amount | After the call |
| List lead fields | Lists your custom lead columns and their Dynamics names, so you know what to give Update lead fields | When setting up |
| Qualify lead | Closes the lead as Qualified and creates an account, a contact and an opportunity from it | After the call |
| Disqualify lead | Closes the lead as Disqualified, No Longer Interested | After the call |
| Log phone call on lead | Adds an incoming call and a summary to a lead's timeline | After the call |
| Log outbound phone call on lead | Adds an outgoing call and a summary to a lead's timeline | After the call |
| Add note to lead | Adds a note to a lead, such as the call transcript | After the call |
| Create follow-up task on lead | Leaves a task for your team on a lead, with a due time if the caller gave one | After the call |
| Log phone call on contact | Adds an incoming call and a summary to a contact's timeline | After the call |
| Add note to contact | Adds a note to a contact, such as the call transcript | After the call |

We recommend running only **Find lead by phone** during the call, so your agent knows who is
calling straight away. Everything else suits the time after the call: the caller never waits for
Dynamics, and the after-call workflow sees the whole conversation before it writes anything.

## Know the caller during the call

Open **Find lead by phone** in your agent's **Actions** tab and set its **Trigger** to **During and
after the call (post-call)**. That keeps it available to the after-call workflow as well; choose
**During the call** if you only want the lookup.

Then say when to use it in your agent's **Prompt** tab, for example:

```text theme={null}
At the start of the call, look the caller up in Dynamics with Find lead by phone, using their
phone number. If you find them, greet them by first name and do not ask for details the lead
already has. If you find nobody, ask for their name and company.
```

## Qualify leads and log every call automatically

This workflow suits a business that qualifies inbound callers, such as a lender asking about the
business, how much it needs and how soon. After each call it finds or creates the lead, saves the
answers, logs the call, saves the transcript and, for a qualified caller, leaves a follow-up task
for your team.

**First, find the names of your custom lead columns.** Dynamics knows each column by a name that
can differ from the label you see, for example **Loan Amount** may be `new_loanamount`. Add **List
lead fields** to your agent, open it in the **Actions** tab and run it from there. It lists your
custom lead columns with their names. Note the ones the workflow should fill.

**Then add the actions.** Add **Find lead by phone**, **Create lead**, **Update lead**, **Update lead
fields**, **Log phone call on lead**, **Add note to lead** and **Create follow-up task on lead** to
your agent. An after-call workflow only offers actions whose **Trigger** includes after the call,
so leave them on **After the call (post-call)**, and give Find lead by phone **After the call
(post-call)** or **During and after the call (post-call)**.

**Then build the workflow.** Open your agent's **Post Call Workflows** tab and create a workflow.
Tick the seven actions under **Allowed actions**, paste these instructions, change the column names
and the qualification rule to your own, turn on **Run on real calls**, and save.

```text theme={null}
- Find the caller in Dynamics with Find lead by phone, using the caller's phone number.
- If no lead is found, Create lead with a topic like "Inbound call: <company>", the caller's first and last name, company, email and phone number.
- Update lead on that lead with anything new the caller told you: name, company, job title, email, and a description of what they need in plain sentences.
- Update lead fields on the same lead for the answers that have their own columns, using these names: new_loanamount (amount requested, a number), new_useoffunds (what the money is for), new_timeinbusiness (years in business, a number), revenue (annual revenue, a number). Only include columns the caller gave you a value for.
- Log phone call on lead on the same lead, with the subject "Inbound call" and a two or three sentence summary of what was discussed and agreed.
- Add note to lead on the same lead, titled "Call transcript" with today's date, with a two line summary followed by the full transcript, each line starting with who spoke.
- If the caller is qualified (they need at least 25,000, have been in business at least one year and want to move forward in the next 90 days), Create follow-up task on lead on the same lead, with the subject "Call back about financing" and what they asked for in the details. If they asked for a time, make that the due time.
```

The phone call, note and task carry the time the workflow ran, a few seconds after the caller
hangs up. See [Automate what happens after a call](https://docs.brilo.ai/reports/automate-what-happens-after-a-call) for
workflows in general.

To close the lead from the call as well, add **Qualify lead** or **Disqualify lead** and put it on
the last line of the instructions. Dynamics stops edits to a lead once it is qualified or
disqualified, so it must run after every update, call log and note.

## Calls with existing customers

When the caller is already a customer, Dynamics usually has them as a contact rather than a lead.
Add **Find contact by phone**, **Log phone call on contact** and **Add note to contact**, tick
them in the workflow, and add this line at the top of its instructions:

```text theme={null}
- First try Find contact by phone with the caller's number. If a contact is found, Log phone call on contact and Add note to contact on that contact instead of using the lead steps below, then stop.
```

## Outbound calls

For a campaign that calls your leads, use **Log outbound phone call on lead** in place of **Log
phone call on lead**, so the call shows in Dynamics as an outgoing call.

## What is not supported

* **Dynamics 365 Business Central.** It is a different Microsoft product, without leads. Brilo
  connects to Dynamics 365 Sales.
* **Government and China clouds.** Brilo connects to environments in Microsoft's commercial cloud,
  whose address ends in `.dynamics.com`. GCC, GCC High and Dynamics 365 operated in China are not
  supported.
* **Editing a closed lead.** Dynamics does not allow changes to a lead once it is qualified or
  disqualified. Update lead and Update lead fields return an error on one, which shows in the
  workflow's **Run History**.
* **Custom tables**, such as your own loan application table. Your own columns on the lead table
  work through Update lead fields.
* **Accounts, opportunities and appointments.** Qualify lead creates an account, a contact and an
  opportunity, but no action changes them afterwards.
* **Choosing an owner** for a lead, call, note or task. New records belong to the Brilo
  application user, and your team can reassign them in Dynamics.
* **Sending call recordings to Dynamics.** The call is logged with a summary and the transcript is
  saved as a note, without the audio.

> [!NOTE]
>
> Microsoft allows each app 6,000 requests to an environment every five minutes. Brilo makes a
> handful of requests per call, so this only matters for very large campaigns or when other apps
> share the environment. If Microsoft is limiting requests, wait a few minutes and try again.

> [!NOTE]
>
> If you need one of these, or another Dynamics 365 action, email
> [support@brilo.ai](mailto:support@brilo.ai) with what you are trying to do. What customers ask
> for is how the list grows.

## What else you can do here

* [Decide what your CRM should hold after a call](https://docs.brilo.ai/actions/update-your-crm.md).
* [Put a summary of every call where your team reads it](https://docs.brilo.ai/reports/personalised-call-summary.md).
* [Automate other work when a call ends](https://docs.brilo.ai/reports/automate-what-happens-after-a-call).
* [Reach a system that is not in the app store](https://docs.brilo.ai/actions/build-a-custom-action.md).

## If it did not work

**Brilo says "Approve Brilo in Microsoft first".** Nobody has approved Brilo for your
organization yet, or the approval was made by someone who is not an admin. Close the connection
window, open Microsoft Dynamics 365 Sales in the app store again, click **Connect**, then **Continue**,
and sign in to Microsoft with an admin account. See
[Part 1](#part-1-approve-brilo-for-your-organization).

**You approved Brilo in Microsoft, but Brilo did not open the connection window.** The approval
took more than ten minutes, finished in a different browser, or finished while a different person
was signed in to Brilo. Start again from **Continue** in the same browser. If your workspace already
has a Dynamics connection to another Microsoft organization, remove it first.

**Brilo says "Brilo is approved, but cannot open this environment".** The approval worked, but
Brilo is not yet an application user in this environment. Do the **Add Brilo to your Sales
environment** step above, and check that the **Environment URL** you pasted is the same
environment you added Brilo to. Then click **Test connection** again.

**Brilo says "That is not a Dynamics 365 address".** Paste the **Environment URL** from Power
Platform admin center, like `https://contoso.crm.dynamics.com`, not the address of a page inside
Dynamics.

**Brilo says "Microsoft refused the sign in".** The approval was removed in Microsoft, or never
finished. Start again from **Continue** and sign in as an admin.

**Your agent did not find a caller who is a lead in Dynamics.** Find lead by phone checks the
lead's business, home and mobile numbers. Make sure the lead has the number in one of them, and
that the action's **Trigger** includes during the call and your **Prompt** tells your agent to look
the caller up at the start.

**Nothing appeared on the lead after a call.** Check that **Run on real calls** is on, then open the
workflow's **Run History**. A lead that was already qualified or disqualified cannot be changed.

Anything else: [An action did not run](https://docs.brilo.ai/actions/an-action-didnt-run.md).

## FAQ

> **Does Brilo work with Microsoft Dynamics 365?**
>
> Yes, with Dynamics 365 Sales. Connect it from the app store: a Microsoft admin approves Brilo,
> adds it as an application user in your Sales environment and pastes the environment URL. Your
> agent can then find callers, create, update, qualify and disqualify leads, log calls, save
> transcripts as notes and leave follow-up tasks. Business Central is not supported.

> **Is my Dynamics data shared with anyone?**
>
> No. Brilo reads and writes only what your agent's Dynamics actions need, in the one
> environment you connected, and only as the Brilo application user with the role you gave it.
> Your Dynamics data is not shared with other Brilo customers. To limit Brilo further, give its
> application user a security role with fewer permissions.

> **How do I stop Brilo from accessing Dynamics 365?**
>
> There are three ways, and any one is enough. In the Brilo app store, open Microsoft Dynamics
> 365 Sales, click Connected and remove the connection. In Power Platform admin center, open your
> environment's Application users and remove Brilo for Dynamics. Or, in Microsoft Entra admin
> center, remove Brilo for Dynamics from your Enterprise applications, which stops it for
> every environment at once. The Dynamics actions stop working straight away.

> **Does Brilo work with Dynamics 365 Business Central?**
>
> Not yet. Business Central is a separate Microsoft product for accounting and operations, and it
> has no leads. Brilo connects to Dynamics 365 Sales. If your team uses Business Central, email
> [support@brilo.ai](mailto:support@brilo.ai) with what you want your agent to do there.

> **Can Brilo fill my own custom lead columns?**
>
> Yes. Update lead fields sets any column on the lead table, including ones your team added,
> such as a loan amount or the use of funds. List lead fields shows each custom column's
> Dynamics name, which is what the after-call workflow uses.

> **Can Brilo save the call transcript in Dynamics 365?**
>
> Yes. In the after-call workflow, Add note to lead saves a short summary and the full transcript
> as a note on the lead, and Log phone call on lead records the call itself with a summary. Very
> long calls may be shortened in the note.

> **Will Brilo create duplicate leads in Dynamics 365?**
>
> Not when the workflow looks the caller up first. Find lead by phone checks Dynamics before
> anything is written, and the workflow creates a lead only when nobody matches. If your
> environment has duplicate detection on, Dynamics can also refuse a new lead that looks like an
> existing one.

> **Who at my company needs to approve Brilo in Microsoft?**
>
> A Microsoft admin, in two places. A Global Administrator, Application Administrator or Cloud
> Application Administrator approves Brilo for your organization, starting from Continue in the
> Brilo app store. Then a Power Platform or Dynamics 365 administrator adds Brilo for Dynamics
> as an application user with the Salesperson role in your Sales environment. The admin section
> of this page has every click.

> **Do I need a developer to connect Dynamics 365 to Brilo?**
>
> No. There is no code and no key to copy. You need a Microsoft 365 or Dynamics admin for about
> ten minutes, to approve Brilo, add it as an application user and paste the environment URL.

## Related

* [Update your CRM](https://docs.brilo.ai/actions/update-your-crm.md) for what is worth writing after a call
* [What are actions](https://docs.brilo.ai/actions/what-are-actions.md) for how a connected app gets used on a call
* [Automate what happens after a call](https://docs.brilo.ai/reports/automate-what-happens-after-a-call) for
  after-call workflows
* [Supported integrations](https://docs.brilo.ai/supported/integrations.md) for everything else Brilo connects to
* [An action did not run](https://docs.brilo.ai/actions/an-action-didnt-run.md) when nothing reaches Dynamics


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.