> For the complete documentation index, see [llms.txt](https://docs.inogic.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.inogic.com/next-best-action/configuration/configure-application-user.md).

# Configure Application User

To configure Application user follow the below steps:

#### **Create an App Registration in Microsoft Entra ID (to obtain the three keys)** <a href="#create-an-app-registration-in-microsoft-entra-id-to-obtain-the-three-keys" id="create-an-app-registration-in-microsoft-entra-id-to-obtain-the-three-keys"></a>

* Open the Azure portal for the **Microsoft Entra ID (Azure AD)** tenant that hosts the Dataverse environment (this may be a different tenant than where the container app is deployed).

<figure><img src="https://272130504-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M0QoyqUVI8_HaZ9FOSL%2Fuploads%2FG7F2jVtdvjyobZlFywch%2Fap1.png?alt=media&amp;token=d47a68fa-5f6b-4cf8-918b-c6a6768a5a98" alt=""><figcaption></figcaption></figure>

* Navigate to **Manage → App registrations** and click **New registration.**

<figure><img src="https://272130504-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M0QoyqUVI8_HaZ9FOSL%2Fuploads%2Fnri5RYslFcCQdcskJGp2%2Fap2.png?alt=media&amp;token=41097f8d-bccb-4369-8efd-cf2a6423331d" alt=""><figcaption></figcaption></figure>

* Enter the **application name** and select the first (default) option for supported account types, then click **Register.**

<figure><img src="https://272130504-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M0QoyqUVI8_HaZ9FOSL%2Fuploads%2FONIrtMYb2ZZHpgpKfMt1%2Fap3.png?alt=media&amp;token=85e176a9-5e83-4056-b7d5-ea3e087a7f64" alt=""><figcaption></figcaption></figure>

* Copy the Directory (tenant) ID → this becomes d365-tenant-id.
* After the app registration is created:
* Open the application registration and copy the Application (client) ID → this becomes d365-client-id and Copy the Directory (tenant) ID → this becomes d365-tenant-id.

<figure><img src="https://272130504-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M0QoyqUVI8_HaZ9FOSL%2Fuploads%2Feiup9Gk6NzPS63RJwAor%2Fap4.png?alt=media&amp;token=a70d5454-bdce-45d4-86c1-045283a267ec" alt=""><figcaption></figcaption></figure>

#### **Grant API Permissions for Dynamics CRM** <a href="#grant-api-permissions-for-dynamics-crm" id="grant-api-permissions-for-dynamics-crm"></a>

In the app registration, go to Manage → API permissions → Add a permission. Select Dynamics CRM from the API list.

<figure><img src="https://272130504-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M0QoyqUVI8_HaZ9FOSL%2Fuploads%2FPZgOlaTU161JBbd8zuat%2Fap5.png?alt=media&amp;token=bc63e845-cd2e-4f15-a773-007dc812e549" alt=""><figcaption></figcaption></figure>

Choose Delegated permissions and then check **user\_impersonation**, then **click Add permissions**.

<figure><img src="https://272130504-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M0QoyqUVI8_HaZ9FOSL%2Fuploads%2FGXAQoGkpWs4M8NYJaaYK%2Fap6.png?alt=media&amp;token=0cacd47c-0bcf-4a0e-84ce-c8136093af6f" alt=""><figcaption></figcaption></figure>

Click **Grant admin consent** to apply the permission for the tenant. This ensures the app can call Dynamics CRM APIs as the signed-in user.

<figure><img src="https://272130504-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M0QoyqUVI8_HaZ9FOSL%2Fuploads%2FrtF879iRJDua64UZTJnW%2Fap7.png?alt=media&amp;token=92378351-cf27-4aea-b3e5-862d5fcf9c4c" alt=""><figcaption></figcaption></figure>

#### **Create a Client Secret (d365-client-secret)** <a href="#create-a-client-secret-d365-client-secret" id="create-a-client-secret-d365-client-secret"></a>

In the app registration, go to **Manage → Certificates & secrets → New client secret**. Create a new secret and optionally set its expiry. Click **Add**.

<figure><img src="https://272130504-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M0QoyqUVI8_HaZ9FOSL%2Fuploads%2FVr5hB5hM6RFNjOgxoFBH%2Fap8.png?alt=media&amp;token=41c79309-a843-4069-b7a7-07cb4efa321b" alt=""><figcaption></figcaption></figure>

**Immediately copy the secret value** — this value is shown only once. This copied value is the d365-client-secret you will add to the Container App secrets. **If you leave the page, you cannot retrieve this value later.**

<figure><img src="https://272130504-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M0QoyqUVI8_HaZ9FOSL%2Fuploads%2FJ8b0qroscGjZCA6vNiFk%2Fap9.png?alt=media&amp;token=9ebd5223-7768-4b7f-a5c0-222277cd1c84" alt=""><figcaption></figcaption></figure>
