docs/integrations/app-integrations/microsoft-onedrive.mdx
This documentation describes the integration of MindsDB with Microsoft OneDrive, a cloud storage service that lets you back up, access, edit, share, and sync your files from any device.
Accounts in this organizational directory only option for the Supported account types field.Files.Read permission and select it.client_id parameter, and copy the Directory (tenant) ID and record it as the tenant_id parameter.client_secret parameter./verify-auth in the Redirect URIs field. For example, if you are running MindsDB locally (on https://localhost:47334), enter https://localhost:47334/verify-auth in the Redirect URIs field.Establish a connection to Microsoft OneDrive from MindsDB by executing the following SQL command:
CREATE DATABASE one_drive_datasource
WITH
engine = 'one_drive',
parameters = {
"client_id": "12345678-90ab-cdef-1234-567890abcdef",
"client_secret": "abcd1234efgh5678ijkl9012mnop3456qrst7890uvwx",
"tenant_id": "abcdef12-3456-7890-abcd-ef1234567890",
};
Required connection parameters include the following:
client_id: The client ID of the registered application.client_secret: The client secret of the registered application.tenant_id: The tenant ID of the registered application.Retrieve data from a specified file in Microsoft OneDrive by providing the integration name and the file name:
SELECT *
FROM one_drive_datasource.`my-file.csv`;
LIMIT 10;
At the moment, the supported file formats are CSV, TSV, JSON, and Parquet. </Tip>
<Note> The above examples utilize `one_drive_datasource` as the datasource name, which is defined in the `CREATE DATABASE` command. </Note>The special files table can be used to list the files available in Microsoft OneDrive:
SELECT *
FROM one_drive_datasource.files LIMIT 10
The content of files can also be retrieved by explicitly requesting the content column. This column is empty by default to avoid unnecessary data transfer:
SELECT path, content
FROM one_drive_datasource.files LIMIT 10
client_id, client_secret and tenant_id parameters are correctly provided.