From 587c02fab22a95502ef7655f526015bda589fd58 Mon Sep 17 00:00:00 2001 From: jeadie Date: Tue, 17 Sep 2024 10:11:44 +1000 Subject: [PATCH] sharepoint quickstart --- sharepoint/README.md | 52 ++++++++++++++++++++++++++++++++++++++++ sharepoint/spicepod.yaml | 10 ++++++++ 2 files changed, 62 insertions(+) create mode 100644 sharepoint/README.md create mode 100644 sharepoint/spicepod.yaml diff --git a/sharepoint/README.md b/sharepoint/README.md new file mode 100644 index 0000000..cec4409 --- /dev/null +++ b/sharepoint/README.md @@ -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= +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. diff --git a/sharepoint/spicepod.yaml b/sharepoint/spicepod.yaml new file mode 100644 index 0000000..5d98655 --- /dev/null +++ b/sharepoint/spicepod.yaml @@ -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}