> For the complete documentation index, see [llms.txt](https://doc.dastra.eu/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://doc.dastra.eu/en/features/settings/integrations-onedrive-google-drive.md).

# OneDrive & SharePoint / Google Drive integrations

This page explains how to connect Dastra to Microsoft OneDrive & SharePoint or Google Drive to use your cloud storage as the main document management system for the workspace.

## Why use custom cloud storage?

By default, Dastra's [document management system](/en/features/document-management.md) relies on Azure Blob Storage: files are encrypted, scanned for viruses, and redundantly stored on a secondary server. For more details, see the [security documentation](/en/security/general.md).

In some organizations, this storage duplicates an existing cloud file system (SharePoint, OneDrive, Google Drive). Dastra integrates natively with these providers to avoid this duplication:

* **Microsoft OneDrive & SharePoint** — a OneDrive or a **SharePoint document library** of your Microsoft 365 tenant;
* **Google Drive**.

<figure><img src="https://2697025545-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LvBxs22wUMicv9uWp6C-1972196547%2Fuploads%2Fgit-blob-67918affe4d111b11b9eede0f78185884a07e8f7%2Fsettings-files-attachment-panel.png?alt=media" alt="File source selector in the Dastra document manager"><figcaption><p>Files can be stored in Dastra, OneDrive &#x26; SharePoint, or Google Drive</p></figcaption></figure>

## Connection type: user OAuth

{% hint style="warning" %}
This integration uses **OAuth authentication with a user account's credentials**. It is not an application-level connection via the Microsoft Graph API or the Google API.

In practice, this means:

* The connection is established **on behalf of the user** who configures the integration
* Access to files depends on **that account's permissions**
* If the account is deactivated or its tokens revoked, the integration stops working until it is reconnected
* It is recommended to use a **dedicated service account** (non-personal) to configure this integration
  {% endhint %}

## Setting up the integration

Go to **Workspace Settings > Integrations**, then click on **Microsoft OneDrive & SharePoint** or **Google Drive**.

Click **Add integration**. You will be redirected to the provider's login page, where you will be asked to authorize access to your storage.

### Choosing the drive (OneDrive & SharePoint only)

After authentication, Dastra lists the drives the connected account can reach. Choose the one Dastra will use in **Choosing the Root Drive**:

| Option                               | Description                                                  | Recommendation                                                                  |
| ------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------------------------- |
| **/** (e.g. `Root site / Documents`) | A document library of a SharePoint site of your organization | ✅ Recommended for enterprise use — shared space, not tied to a personal account |
| **Your personal drive**              | Personal OneDrive of the connected account                   | ⚠️ Avoid in production — grants access to all personal drive files              |

Click **Refresh** if a site or library you just created does not appear yet.

{% hint style="info" %}
If you use a personal drive, it is strongly recommended to use a dedicated service account that does not contain personal files. You can also create a [dedicated SharePoint site](https://learn.microsoft.com/en-us/sharepoint/create-site-collection) to isolate Dastra files.
{% endhint %}

### Choosing a root folder (OneDrive & SharePoint only)

By default, Dastra uses the **root of the drive**. You can restrict it to a folder of the drive:

1. Under **Root folder**, click **Choose a folder**.
2. Browse the drive and click **Select** on the folder to use. **Use the root of the drive** goes back to the default.
3. Save the configuration.

Dastra then stores its files in this folder, and browsing from Dastra is limited to it: users cannot go above it. This is the simplest way to share a single folder of a SharePoint library with Dastra, without exposing the rest of the library.

<figure><img src="https://2697025545-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LvBxs22wUMicv9uWp6C-1972196547%2Fuploads%2Fgit-blob-0cd1251bd0a41c31cab37e2bec719e6fcc2d04a8%2Fsettings-files-onedrive-root-folder.png?alt=media" alt="Choosing the drive and the root folder of the OneDrive &#x26; SharePoint integration"><figcaption><p>Choosing the drive and the root folder</p></figcaption></figure>

{% hint style="warning" %}
The root folder limits what Dastra shows and where it writes. It does not change the permissions of the connected account in Microsoft 365: that account keeps access to everything it could already open. To restrict access on the Microsoft side as well, connect the integration with a service account that only has access to the chosen library or folder.
{% endhint %}

If the root folder is deleted or moved in SharePoint or OneDrive, Dastra displays an error asking you to choose another folder in the integration settings.

## Attaching cloud files to a Dastra entity

From any entity (processing activity, task, actor…), you can attach files stored in your cloud:

1. Open the file panel of the entity
2. Select the **data source** at the top left of the panel

![](https://2697025545-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LvBxs22wUMicv9uWp6C-1972196547%2Fuploads%2Fgit-blob-6c1f6a842f0a6ea4e69fffd05e5fdccd23738cfd%2Fsettings-files-manager-header.png?alt=media)

3. Browse your drive via the file manager
4. Click **Select from manager** to attach the file

![](https://2697025545-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LvBxs22wUMicv9uWp6C-1972196547%2Fuploads%2Fgit-blob-688b7eb743868009402aa27361b2edb2756c410a%2Fsettings-files-select-from-manager.png?alt=media)

You can also upload new files directly from Dastra to your drive.

A storage whose use case is deactivated in the integration settings is no longer offered as a data source.

## Limitations

### OneDrive & SharePoint

* The connection uses user OAuth — not the Microsoft Graph API. If the account that set up the integration is deactivated, the connection is interrupted.
* Dastra only works in the chosen drive, and in its root folder when one is set.
* For enterprise environments, prefer a SharePoint document library over a personal drive.

### Google Drive

* Only files **created from within Dastra** can be added or modified in Google Drive. Dastra does not have access rights to files created directly in Drive — this is a limitation of the OAuth connector.
* Files created in Dastra can be shared with other collaborators without restriction.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://doc.dastra.eu/en/features/settings/integrations-onedrive-google-drive.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
