> 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/attach2dynamics/windows-tool/windows-task-scheduler/azure-client-id-and-client-secret-configuration.md).

# Azure Client ID and Client Secret Configuration

The Attach2Dynamics Scheduler Tool uses an Azure application to authenticate with the Dataverse environment. The Application (Client) ID and Client Secret are required in the command-line arguments.

The credentials required depend on whether you are using the SharePoint Connector or Azure Blob Storage.

#### If You Are Using the SharePoint Connector

If you have already configured and authenticated the SharePoint Connector, you can reuse the existing **Application (Client) ID** and **Client Secret** for the Attach2Dynamics Scheduler Tool.

There is no need to create a new Azure application or generate separate credentials.

* Retrieve the existing Application (Client) ID and Client Secret from the SharePoint Connector configuration.
* Use the same credentials in the Scheduler Tool configuration.
* If the existing Client Secret has expired, generate a new Client Secret for the same Azure application.
* Update the new Client Secret in the SharePoint Connector configuration and authenticate the connector again.
* Use the updated Client Secret in the Scheduler Tool configuration.

#### If You Are Using Azure Blob Storage

If you are using Azure Blob Storage, create a new Azure application registration and generate the required Application (Client) ID and Client Secret for authentication.

Refer to the following guide:

[How to Create an Azure Active Directory App](https://www.inogic.com/blog/how-to-create-azure-active-directory-app/)

After creating the application registration:

1. Open the registered application in Microsoft Entra ID.
2. Copy the **Application (Client) ID**.
3. Navigate to **Certificates & secrets**.
4. Create a new **Client Secret**.
5. Copy the Client Secret Value and store it securely.
6. Configure the required API permissions and grant admin consent, as applicable.

#### Add an Application User in Dataverse

An Application User must be added to the target Dataverse environment for the Azure application used by the Scheduler Tool, regardless of whether you are using the SharePoint Connector or Azure Blob Storage. Ensure that the Application User is assigned the required security role and permissions to access the Dataverse environment.

If the Application User is already configured with the required role, you do not need to add it again. Otherwise, follow the steps below to add it.

1. Open the [Power Platform Admin Center](https://admin.powerplatform.microsoft.com/).
2. Select the target Dataverse environment.<br>

<figure><img src="https://272130504-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M0QoyqUVI8_HaZ9FOSL%2Fuploads%2F7yoNtrwVY0Flv4n6dSO2%2Fimage.png?alt=media&amp;token=890a0f45-0d5a-4e35-b3ca-32cb5c98998b" alt=""><figcaption></figcaption></figure>

3. Navigate to Settings.
4. Select Users + Permissions → Application users.
5. Select Add an app user.

<figure><img src="https://272130504-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M0QoyqUVI8_HaZ9FOSL%2Fuploads%2FeKqrWDuBx9axhiTCSKOA%2Fimage.png?alt=media&amp;token=ddecc036-f692-482d-be42-a01d48ae5ff2" alt=""><figcaption></figcaption></figure>

6. Select the Azure application registration created earlier.

<figure><img src="https://272130504-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M0QoyqUVI8_HaZ9FOSL%2Fuploads%2Fzirk2D3p0vBPLrHCGklq%2Fimage.png?alt=media&amp;token=c02a93e3-5515-4733-862d-c904d2cf49a9" alt=""><figcaption></figcaption></figure>

7. Assign the required security role. Use System Administrator if required by your deployment.
8. Verify the application and environment, then select Create.

Ensure that the Application User exists in the correct environment and has the required permissions before running the scheduled task.

#### Use the Application Credentials in Task Scheduler

Provide the appropriate Application (Client) ID and Client Secret in the command-line arguments.

**Command Format:**

```
--clientId "<CLIENT_ID>" --clientSecret "<CLIENT_SECRET>"
```

Replace the placeholders with the actual credentials from the SharePoint Connector configuration or the Azure application registration used for Azure Blob Storage.
