# Prerequisite

### Setup Instructions

Follow the steps below to create an OAuth app and obtain the OAuthClientId, and OAuthClientSecret for the[ Dynamics 365 Business Central](https://lyftron.com/source/data-migration-from-dynamics-365-business-central-to-snowflake-google-bigquery-amazon-redshift-and-azure-sql-database/) driver setup with [Lyftrondata](https://www.lyftrondata.com)

### Video Instructions

{% embed url="<https://www.loom.com/share/56a993c697c44ae99b6b4de80ee25e3e>" %}
Lyftrondata Dynamics 365 Business Central 365 Azure App Steps
{% endembed %}

### Manual Instructions

Having trouble following the steps in the video? Don't worry, we've got you covered; simply follow the manual steps outlined below.

1. Log in to [https://portal.azure.com.](https://portal.azure.com)
2. In the left-hand navigation pane, select Azure Active Directory then App Registrations, and click the Add button.&#x20;
3. Enter an app name and set the radio button for "Any Azure AD Directory - Multi-Tenant". Then set the redirect URL to something such as <https://oauth.lyftrondata.net/oauth2>, the driver's default. Or, set a different port of your choice and set CallbackURL to the exact reply URL you defined.
4. After creating the app, go to the Certificates & Secrets section, create a Client Secret for the app and select a duration.&#x20;
5. After you save the key, a value for the key is displayed once. Set OAuthClientSecret to the key value. Set OAuthClientId to the Application Id.
6. Select API Permissions and then click Add. If you plan for your app to connect without a user context, select the Application Permissions (OAuthGrantType = CLIENT). Otherwise, when selecting permissions, use the Delegated permissions.&#x20;
7. Select Required Permissions and then click Add. Under Select an API, select the Dynamics 365 Business Central -> Delegated Permissions.&#x20;
8. Save your changes.&#x20;
9. If you have selected to use permissions that require admin consent (such as the Application Permissions), you may grant them from the current tenant on the API Permissions page. Otherwise, follow the steps under Admin Consent.

### Step1: Acquiring Third-Party Credentials

1. Open the [Microsoft Azure Portal](https://portal.azure.com/), and enter valid login credentials to continue. On the **Microsoft Azure** dashboard, click **App registrations** on the **Azure services** menu at the top. If **App registrations** are not visible, click **More services**, on the right of the menu, for a longer list of options.

### Step2: App Registration

<figure><img src="https://lh3.googleusercontent.com/6yCcapnKI0_EGcCT9W5hECQ80J1Lt01oua8uKHs3YwZMcMQXtxWh2KyUSvWuC1tVnCD9gcP2R6isfbSioB1p9yFc-qtv92eKHoy2kKJMl_dEaD-uSCinjYpS2hES-hE92OsC3mB5Uxc88XTeNUl4fVdrUphi5VVsGbDRrIkekOiAT7eRuq0bfB2XS4sghu4X" alt=""><figcaption><p>Azure Services Lyftrondata</p></figcaption></figure>

2\.  On the **App registrations** page, click **+ New registration** on the menu at the top of the screen.

3\.  On the **Register an application** page, provide details for the following fields:&#x20;

* **Name**: provide a name for the app.&#x20;
* **Supported account types**: select **Accounts in any organizational directory (Any Azure AD directory - Multitenant) and personal Microsoft accounts (e.g. Skype, Xbox).**&#x20;
* **Redirect URI**: Select **Web** in the drop-down field and paste the Callback URL which will be <mark style="color:blue;">**<https://oauth.lyftrondata.net/oauth2>**</mark> (copied from the **Manage OAuth** window in Lyftrondata ETL earlier). Note that although the page states this field is optional, you **must** complete it.&#x20;

Click **Register**.

<figure><img src="https://lh3.googleusercontent.com/EVC6IRiyyGYOENV4IQxMfmPJH2btOXh-FMLGiB4aUpAlSq6RDBf3kd6j9M5lgZCZmfscvIRS2crEMuGiZWIZQMlxMi4RybJbR2G3Ms9HqGbp4YbCXHlMhRdnm4BpXSFQxbacYO6nNy4thjibN1nLMZtXrt6O7noPcbzstXdDCXKl9_J8bxndh336-t26qxM2" alt=""><figcaption></figcaption></figure>

4\.  The browser will then redirect to the **Overview** page on the app's newly created dashboard. From here, copy the credentials to the right of the **Application (client) ID** and **Directory (tenant) ID**, as they will be required later in Authorizing for use in Lyftrondata ETL.&#x20;

<mark style="color:red;">**Warning**</mark>**:** When copying the credentials, some browsers may add a space to the end of the string. This will cause the credentials to fail.

<figure><img src="https://lh6.googleusercontent.com/UOEDUAwIKVIog-bAe_O76-pOcrhqutG39GhJFnLirndyKML7_EHXKWr4ttv3n_9oVWJKicQF5fe1sFgRFHmDkke7zZmlFif9dc3erlsCiKPUR53tq-wm93b8OeQcY9BCM_2JLIZwDNS0XAKbK-5BP_LDkZpNmZXLsenjn3GgPeZAJqz1iR1-1g8UgLkOPZ5p" alt=""><figcaption></figcaption></figure>

5\.  On the menu on the left, click **Authentication**. Scroll down to the **Implicit grant and hybrid flows** section, select the checkbox next to **ID tokens (used for implicit and hybrid flows**), then click **Save** at the top of the page.

<figure><img src="https://lh4.googleusercontent.com/G3hT76_qZw-s4Vp4_Xjhr5jNdwECCdh6luQW0unJGunKoY4NqXyPT6XIszgBjH4oNCo3gqSZ-YbVn4uOHP26KvDRzJI-LgJmpkeNDk5pfY1E6Cpa6iVEuZZiVlfXxAbQgaAh7_tIC9ZE5PriqV7LdPync-iBbA13O26gXXzBprjzWwRxWpk19Wm9hK87K1tY" alt=""><figcaption></figcaption></figure>

6\.  Click **Certificates & secrets** on the menu on the left, and on the **Certificates & secrets** page click + **New client secret**.

7\.  The **Add a client secret** page will appear to the right. Provide details for the following fields:&#x20;

* **Description**: provide a description of the client's secret.
* **Expires**: use the Expires drop-down to select when the client secret should expire, then click Add.

8\.  You will automatically be returned to the **Certificates & secrets** page, where the new client secret will appear in the list in the **Client secrets** tab. Copy the client's secret **Value**, as it will be required in Authorizing for use in Lyftrondata.&#x20;

<mark style="color:red;">**Warning**</mark> &#x20;

* Make sure to copy the client's secret right away as it may appear only once.
* Additionally, when copying the client's secret, some browsers may add a space to the end of the string. Watch out for this as it will cause the credentials to fail.

<figure><img src="https://lh6.googleusercontent.com/La9ZAGz-srBEg79OYrnkQVK5mpJ9I6DorYS7v8MRbR0J_KSND77-jAK04ti72CGy-SmCDiyuXpYQrYCn5GtN6p_dvRMh3H3qZ54dwukmcpGOQ8y_rHvnKHKuZ1FFn7TVG-OtMw3SdCAzFX4uKNsyCOxJLczcNhUnLsH1_45NvG6JWYuT6UR--nhKoCzI9-Wh" alt=""><figcaption></figcaption></figure>

### Step3: Add API Permission

9\.  Click **API permissions** on the menu on the left, then click **+ Add permission** to open the **Request API permissions** panel on the right of the screen.

10\.  In the **Request API permissions** panel, click **Dynamics 365 Business Central** in the list of Microsoft APIs.

<figure><img src="https://lh3.googleusercontent.com/T1fKXrOIvslL5xUbXsrCzAHwGfNBmSKmWCN960giBPNBzL7ZLoRqv0bWvtZaZd26OEyiXaSMW5JB1d3kc41Qxn6rGLuJvPY7GVR-SThZ5mjfyhfk8BgEj4PJbMV5c-j1TB35WkfpRGqb3P5doDvywI2Q01BDLWvccSEzw891NS6EpyfPhdccstWMiK6esMsq" alt=""><figcaption></figcaption></figure>

11\.  This will open the **Dynamics 365 Business Central** panel. Select **Delegated permissions**, and then select **user\_impersonation Access as the signed-in user**. Then click **Add permissions**.

<figure><img src="https://lh6.googleusercontent.com/iwkL6Cci4vgIHF9EOxOUNv9bYg_cfn42p6U9DkAs_9FfBysZTSrpjyt846m7_dLOFmhf1SSGE5CdjNd0ItMfkYLA4nYqt_HSISe-63wxTz-bvB4rP0a0e5aip2fIgAJgS9xRFpa3DurffTc10Y-eXwKn0O15y-QedP2DK8jQNBC7AqvG6hC134SYPDrkqEe0" alt=""><figcaption></figcaption></figure>

12\.  Click on grant admin consent and click yes for confirmation. Make sure all the status should show green tick marks against Dynamics 365 Business Central permission.

<figure><img src="https://lh4.googleusercontent.com/T2zTlC1KToa2RPlwgDcw8LTC9ADnw6KkbzRDRtNLxg1DCK70187lIlvtUMBDsP5fyjcSa6Jd7k5hxTpeAsXSHJictruLS7QmSVrbZ_oiE7hor-7-IcoH4fe8eeNCuexMCt7RRZ6ctWOl0OLeZGjUtCrv-aPk_nkNxLuEXZlTDoTCs_jJnDSQ1z4xC3QVuM6p" alt=""><figcaption></figcaption></figure>

13\.   Click **Expose an API** in the menu on the left. Before a scope can be added, an **Application ID** **URI** will need to be set. Click the pencil (edit) icon to the right of the **Application ID URI** field to edit it. Replace the suggested URI with the URI to be associated with the app, then click **Save**.

<figure><img src="https://lh3.googleusercontent.com/4KN43YDMSptyW50zthEMtqiOGSrnpBsWk8g1GUaj6s1MfklEOw5ftwsWaEqDKvXkflbGOSG7R8dlej1cphMs8EP8ndGGhbvSO6IsOdct-EcmBKUC3LWuTqE4QvLe0KkIsJEGRZgYeuHL49sq2LvpFMEUgKE4JehOMOvsBeMKLUC732bBdeKdwydXrRzP5KwL" alt=""><figcaption></figcaption></figure>

### Step4: Add Scope

14\.  Click **+ Add a scope.** The **Add a scope** panel will appear on the right. Provide details for the following required fields:&#x20;

* **Scope name:** a display name for the scope when access to the API is requested. Best practice dictates using a \<resource.operation.consent> name structure.&#x20;
* **Who can consent?** select which users can consent to this scope in directories where user consent is enabled: Admins and users, or Admins only.
* **Admin consent display name**: a name for the scope to be displayed on admin consent screens.&#x20;
* **Admin consent description**: a detailed description of the scope to be displayed on admin consent screens.

&#x20; Click **Add scope.**

<figure><img src="https://lh4.googleusercontent.com/6hQiG7yJ9KQ7h5r-oQo6kV6unDKOfq9UZr6Z-OynHtBsOfNrF69Xq-lEPTQjP0GqXkQXTwdpXck2WaVuUwAvd6gmeztRu28lJlAFTfybTpR-GwYfIha5NV2Z5VF9sSXC66FvlLpsOWJa8Ale1OHuQInfCf9XFY1Z0GaESnx-zXKNZddWJIz0fWm1doj-fYXK" alt=""><figcaption></figcaption></figure>

15\.  Next, navigate to the [Office 365](https://www.office.com/apps?auth=2) Home page, giving your sign-in credentials if requested.&#x20;

* Click the Business Apps tab at the *top*.&#x20;
* Click the Dynamics 365 - custom app. This will open a Dynamics 365 dashboard. The page's URL will contain your Dynamics 365 account URL.
* Copy everything before and including dynamics.com, for example, <mark style="color:blue;"><https://companyname.crm11.dynamics.com/main.aspx#414717258></mark>&#x20;

This copied URL will be required in establishing a connection with Lyftrondata.

### Quickstart Steps

Do you have questions about how to use the platform? Don't worry; we've got you covered. Simply follow the quickstart instructions [here](https://docs.lyftrondata.com/documentation/readme/quickstart-steps).

### Questions? <a href="#questions" id="questions"></a>

We're always happy to help with any other questions you might have! [Set up a meeting with our experts](https://www.lyftrondata.com/book-a-meeting/).
