# Authorize Dynamics 365 F\&O

## 1. Find your Microsoft Dynamics Environment URL

Your environment URL is the base address of your D365 F\&O instance. To find it, copy the URL from your browser when you are in the application.

Examples:

* Production: `https://yourorg.operations.dynamics.com`
* Sandbox: `https://yourorg.sandbox.operations.dynamics.com`

### 2. Select Dynamics 365 Finance

In Stacksync:

1. Click **Create Sync**
2. Choose **Dynamics 365 Finance & Operations**<br>

   <figure><img src="https://2867423571-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FfJjIdV9cuW6K8asJjTPJ%2Fuploads%2FgdRZF5IMitpBeZlynPzY%2Fimage.png?alt=media&#x26;token=b892a60d-5e9c-4508-9879-051e7aef1a83" alt=""><figcaption></figcaption></figure>

This opens the authorization flow.

***

### 3. Enter Your Environment URL

Provide the base URL of your D365 Finance & Operations environment you retrieved in the first step.<br>

<figure><img src="https://2867423571-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FfJjIdV9cuW6K8asJjTPJ%2Fuploads%2FDL7tVjNCQZD5Kyw8UbCz%2Fimage.png?alt=media&#x26;token=e438414f-19c7-4f36-9724-9edd93884199" alt=""><figcaption></figcaption></figure>

Click **Authorize App**.

***

### 4. Sign In with Microsoft

You will be redirected to Microsoft’s login page.

1. Enter your Microsoft credentials
2. Continue to the permissions screen

This authenticates you as a valid D365 user.

***

### 5. Grant Stacksync Access

Microsoft will ask you to approve the Stacksync app.

Click **Accept** to authorize:

* Permission to read ERP data
* Permission to interact with OData entities

If you see this message:

> *“Need admin approval for this app.”*

Ask your admin to:

* Open the Microsoft identity / directory admin portal and go to the **enterprise applications / app registrations** area.
* Locate the **Stacksync** application or the corresponding app registration.
* Review and grant the requested API permissions (for example, access to Dynamics 365 F\&O APIs).

Once an admin has granted consent, the “Need admin approval” screen will no longer appear when you authorize Stacksync. You can then restart the authorization from step 2, and the flow will complete successfully, allowing Stacksync to connect to your Microsoft account and start syncing data.

If you have any questions or run into any blockers, reach out anytime at <hello@stacksync.com> and the Stacksync team will be happy to help.
