---
title: Configure authentication to Microsoft 365
description: Configure Microsoft 365 unified auditing and a Microsoft Entra application for authentication from the managed connector in Databricks Lakeflow Connect.
canonical_url: https://docs.databricks.com/gcp/en/ingestion/lakeflow-connect/microsoft-365-source-setup
---

# Configure authentication to Microsoft 365

> [!NOTE]
> **Beta**
>
> This feature is in [Beta](https://docs.databricks.com/gcp/en/release-notes/release-types.md). To use it, a workspace admin must turn on **Lakeflow Connect for Microsoft 365 Unified Audit Logs** from the **Previews** page. See [Manage Databricks previews](https://docs.databricks.com/gcp/en/admin/workspace-settings/manage-previews.md).

Configure Microsoft 365 to enable authentication from Databricks for the Microsoft 365 Unified Audit Logs connector. Use the application credentials from these steps to create a Unity Catalog connection.

## <a id="prerequisites" />Prerequisites

* Enable [Office 365 unified auditing](https://learn.microsoft.com/purview/audit-log-enable-disable) for your organization.
* Have permission to register an application in Microsoft Entra ID.
* Have permission to grant tenant-wide admin consent for Office 365 Management APIs.

## <a id="register-an-application" />Register an Azure application for OAuth

In this step, you register an application in the Azure portal to enable authentication from Databricks.

### <a id="register-the-application" />Register the application

1. Go to the [Azure portal](https://portal.azure.com/) and search for **Microsoft Entra ID**.
2. In the left pane, go to **Manage > App registrations**, and click **New registration**.
3. On the **Register an application** page:
   1. Enter a user-facing display name for your application.
   2. In **Supported account types**, select **Single tenant only - \<your tenant name>**.
   3. Leave **Redirect URI** blank.
   4. Click **Register**.

### <a id="create-a-client-secret" />Create a client secret

1. In the left pane of the registered application page, go to **Manage > Certificates & secrets**, and click **New client secret**.
2. In the pane that opens, enter a description for the secret, select **24 months** for **Expires**, and click **Add**.
3. Note the credential **Value**, not the **Secret ID**. You use this value in the next step.

### <a id="configure-api-permissions" />Configure API permissions

The Microsoft 365 Unified Audit Logs connector supports only OAuth machine-to-machine (M2M) authentication. It doesn't support delegated OAuth.

1. In the left pane, go to **Manage > API permissions**, and click **Add a permission**.
2. In the **Request API permissions** pane, click **Office 365 Management APIs**.
3. Click **Application permissions**.
4. Select `ActivityFeed.Read`.
5. If you plan to ingest the `dlp_all` source table, also select `ActivityFeed.ReadDlp`.
6. Click **Add permissions**.
7. On the **API permissions** page, click **Grant admin consent for \<your organization>**, next to **Add a permission**, and click **Yes** in the confirmation popup.

### <a id="copy-application-ids" />Copy the application IDs

1. In the left pane, go to **Overview**.
2. Note down the **Application (client) ID** and **Directory (tenant) ID**; you'll use these in the next step.

## <a id="next-steps" />Next steps

Create a Microsoft 365 Unified Audit Logs connection in Databricks. See [Create a Microsoft 365 Unified Audit Logs connection](https://docs.databricks.com/gcp/en/ingestion/lakeflow-connect/microsoft-365-connection.md).
