> AI agents: this is one page from Mammoth Analytics documentation. The index of all pages as Markdown is https://docs.mammoth.io/llms.txt. Append `.md` to any docs URL, or send `Accept: text/markdown`, to get Markdown.

# OneDrive connector

> Connect Mammoth to OneDrive with Azure app credentials, select files from a folder tree, import them as datasets, and export a View back to OneDrive.

The OneDrive connector imports files from **Microsoft OneDrive** into Mammoth as datasets, and can also export a View's results back out to OneDrive. Authentication uses Azure app credentials (Tenant ID, Client ID, Client Secret) tied to a specific user's mailbox/drive—not a per-user OAuth sign-in.

![OneDrive dialog showing No connections and a New Connection button](https://docs.mammoth.io/api/v1/images/20260826_100120_onedrive-noconnectionsscreen.png)

## Before you start

You need an **Azure Active Directory app** registered with Microsoft Graph access to the target OneDrive account. This is a one-time setup, typically done by a Microsoft 365 admin.

### Register the Azure AD app

1. Go to [Azure Portal](https://portal.azure.com) → **Azure Active Directory → App registrations**
2. Click **New registration**—name it (e.g., `Mammoth OneDrive`) and click **Register**
3. Copy the **Application (client) ID**—this is your **Client ID**
4. Copy the **Directory (tenant) ID**—this is your **Tenant ID**
5. Go to **Certificates & secrets → New client secret**, add a description, set an expiry, and click **Add**
6. Copy the secret **Value** immediately (it won't be shown again)—this is your **Client Secret**
7. Go to **API permissions → Add a permission → Microsoft Graph → Application permissions**
8. Add the Files application permission covering the target user's drive
9. Click **Grant admin consent**

You'll also need the **email address / User Principal Name** of the OneDrive account you want Mammoth to read from—this is entered as **User ID** in the connection form.

## Step 1: Select the OneDrive connector

1. In Mammoth, go to **Data Library** and click **+ New Dataset**
2. Select **Connectors**
3. Search for **OneDrive**
4. Click the **OneDrive** tile

If no connection exists yet, you'll see a **No connections** panel with a **New Connection** button.

## Step 2: Create a connection

Click **New Connection** to open the **OneDrive - New Connection** form.

![OneDrive New Connection form with User ID, Tenant ID, Client ID, and Client Secret fields](https://docs.mammoth.io/api/v1/images/20260826_100206_onedrive-newconnectrion.png)

| Field | Description | Example |
| --- | --- | --- |
| **User ID (Email / User Principal Name)** | The OneDrive account Mammoth should read from | `user@yourorg.onmicrosoft.com` |
| **Tenant ID** | Azure AD Directory (tenant) ID | `xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx` |
| **Client ID** | Azure AD Application (client) ID | `yyyyyyyy-yyyy-yyyy-yyyy-yyyyyyyyyyyy` |
| **Client Secret** | The app secret value you created |—|

All four fields are required. Click **Connect** once they're filled in—there's no OAuth sign-in step, since the connector authenticates directly with the app credentials above. If validation fails, the error message appears at the bottom of the form.

## Step 3: Find and select your OneDrive file

After connecting, select the connection under **Existing Connections**. Mammoth shows a **folder tree** of the connected OneDrive account, starting at the root.

- Click a folder to expand it—its contents load on demand (you'll briefly see "Loading folder contents…")
- Check the box next to a file to select it, or check a folder to include everything inside it
- You can select more than one file/folder in a single connection

### Supported OneDrive file types

`.txt` · `.csv` · `.tsv` · `.psv` · `.xls` · `.xlsx` · `.xml` · `.zip` · `.bz2` · `.gz` · `.tar` · `.7z`

## Step 4: Create the OneDrive dataset

Click **Create new dataset**. Mammoth does not ask you to choose an update method for this connector.

To keep the dataset in sync as the source file changes in OneDrive, set up a **Dataset Refresh** automation.

## Exporting to OneDrive

Separately from importing, you can push a View's output *to* OneDrive as an export action:

1. In the data editor, click **Export and Share**, choose **External Destinations**, and select **Export to OneDrive**
2. Fill in **Tenant ID**, **Client ID**, **Client Secret**, and **User ID**
3. Set a **Folder Path** (the default is the root of the user's OneDrive) and a **File Name**
4. Optionally enable **Include hidden columns**

## Troubleshoot OneDrive connections

### Authentication fails

- Check all four values (User ID, Tenant ID, Client ID, Client Secret) are copied correctly
- Confirm admin consent has been granted for the Graph API permission

### OneDrive not found for the specified user

The error "OneDrive not found for the specified user" means the **User ID** doesn't match a valid mailbox/drive in the tenant—double-check for typos in the email/UPN

### Client secret expired

- Client secrets expire based on the duration you set during creation—generate a new secret in Azure Portal and update the connection in Mammoth

### File does not appear in the search list

- Confirm the file is one of the supported formats listed above
- Confirm the file lives in the connected user's own OneDrive, not a folder only shared with them

---
Source: https://docs.mammoth.io/learn/connectors/onedrive-connector.md · Updated: 2026-10-13