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

# Connect Microsoft Dynamics 365 Finance to Watchdog

> Connect Microsoft Dynamics 365 Finance to Watchdog and grant access to invoices and documents.

Connect Microsoft Dynamics 365 Finance to retrieve ExFlow invoices and documents in Watchdog. Watchdog does not change data in Finance.

## Before you begin

This integration uses **ExFlow** in Dynamics 365 Finance. Ask your administrator to confirm that ExFlow invoices and documents are available through the API.

You will need four details:

| Detail        | Description                                                         |
| ------------- | ------------------------------------------------------------------- |
| Base URL      | The Finance environment's root address, without `/data`             |
| Client ID     | The Microsoft Entra app registration ID, also called Application ID |
| Client Secret | The client secret's value                                           |
| Tenant ID     | The Microsoft Entra tenant ID, also called Directory ID             |

## Connect in Watchdog

1. Open **Integrations → Microsoft Dynamics 365 Finance** and add a connection.
2. Enter the details from your administrator.
3. Select **Test Connection**, then save the connection.

## For the Finance administrator

### Create the app registration

1. Open the [Azure portal](https://portal.azure.com/) and go to **App registrations → New registration**.
2. Create an app for Watchdog and copy the **Application (client) ID** and **Directory (tenant) ID**.
3. Create a client secret under **Certificates & secrets**.
4. Copy the secret's **Value** immediately. Watchdog needs the value, not the secret's ID.

### Grant access in Finance

1. Create or select a dedicated service user for Watchdog.
2. Grant the user Data Services read access to `ExFlow_InvoiceHeaders` and `BusinessDocumentDocuRefs`.
3. Open **System administration → Setup → Microsoft Entra applications**.
4. Register the client ID and link it to the service user.

Watchdog uses `client_credentials` authentication. The service user does not need permission to change, approve, or delete invoices.

See [Microsoft's Finance service-access guide](https://learn.microsoft.com/en-us/dynamics365/fin-ops-core/dev-itpro/data-entities/services-home-page). ExFlow access must be confirmed for your installation.

## If the connection test reports a problem

Check the app registration, client secret, and link to the service user. If the test finds invoices but no documents, check document access in Finance. The test checks a sample only; a missing-document warning does not necessarily mean sign-in failed.
