Skip to content
This repository has been archived by the owner on Dec 19, 2024. It is now read-only.

Basic Sharepoint Quickstart #188

Merged
merged 1 commit into from
Sep 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 52 additions & 0 deletions sharepoint/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# SharePoint Data Connector Quickstart

Use the SharePoint Data Connector to query documents stored in SharePoint from Spice.

## Requirements

- [Spice CLI](https://docs.spiceai.org/getting-started) installed.
- Access to a SharePoint instance, and know the associated tenant ID.
- (Optional) Upload relevant documents to the user's root sharepoint directory

## Follow these steps

**Step 1.** Login in Sharepoint via Spice CLI.

```bash
export TENANT_ID=<YOUR_TENANT_ID>
spice login sharepoint --tenant-id $TENANT_ID --client-id f2b3116e-b4c4-464f-80ec-73cd9d9886b4
```

**Step 2.** Start the Spice runtime.

```bash
spice run
```

Confirm in the terminal output that the `important_documents` dataset has been loaded:

```bash
Spice.ai runtime starting...
2024-09-16T12:34:56.789012Z INFO spiced: Metrics listening on 127.0.0.1:9090
2024-09-16T12:34:56.789012Z INFO runtime: Loaded dataset: important_documents
```

**Step 3.** Run queries against the dataset using the Spice SQL REPL.

_In a new terminal_, start the Spice SQL REPL:

```bash
spice sql
```

Query the `important_documents` dataset.

```sql
SELECT web_url FROM important_documents;
```

## Learn more

- [SharePoint Data Connector Documentation](https://docs.spiceai.org/data-connectors/sharepoint).
- [Spice CLI Reference](https://docs.spiceai.org/cli/reference/sql) for SQL queries.
- [Datasets Reference](https://docs.spiceai.org/reference/spicepod/datasets) for more configuration options.
10 changes: 10 additions & 0 deletions sharepoint/spicepod.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
version: v1beta1
kind: Spicepod
name: sharepoint-qs
datasets:
- from: sharepoint:me/root
name: important_documents
params:
sharepoint_client_id: ${secrets:SPICE_SHAREPOINT_CLIENT_ID}
sharepoint_tenant_id: ${env:TENANT_ID}
sharepoint_auth_code: ${secrets:SPICE_SHAREPOINT_AUTH_CODE}
Loading