Import test cases from SharePoint CSV files
Import AI evaluation test cases from SharePoint CSV files using Azure AD certificate authentication for enterprise test management.
Why it matters
Enable teams to manage and import AI evaluation test cases directly from Microsoft SharePoint, allowing centralized test case management in familiar enterprise document repositories with certificate-based authentication.
Outcomes
What it gets done
Authenticate to SharePoint using Azure AD certificate-based credentials
Fetch CSV test case files from SharePoint document libraries
Parse CSV rows into structured test cases with inputs and expected outputs
Load test cases into promptfoo evaluation framework for AI model testing
Install
Add it to your toolbox
Run in your project directory:
curl -fsSL https://spark.entire.vc/get/pfoo-integration-sharepoint | bash Steps
Steps in the chain
Overview
Integration Sharepoint
SharePoint integration example for promptfoo When test cases are stored in SharePoint CSV files
What it does
This promptfoo example demonstrates how to import test cases from CSV files stored in Microsoft SharePoint. It uses Azure AD application credentials with certificate-based authentication to connect to SharePoint sites and pull test data directly into promptfoo evaluations.
When to use - and when NOT to
Use this example when your test cases are maintained in SharePoint CSV files and you need to run promptfoo evaluations against them without manual downloads. It's suitable for teams that already manage test data in SharePoint.
Do not use this if you don't have access to Azure AD application registration or cannot obtain certificate-based authentication credentials. Avoid this approach if your test cases are stored in other systems or if you prefer local file management.
Inputs and outputs
You provide Azure AD credentials (client ID, tenant ID, certificate PEM file path), your SharePoint base URL, and a SharePoint URL pointing to a CSV file with test cases. The CSV must follow this format:
language,input,__expected
French,Hello world,icontains: bonjour
German,I'm hungry,llm-rubric: is german
Swahili,Hello world,similar(0.8):hello world
Prerequisites
This example requires an Azure AD Application with certificate-based authentication, a SharePoint site with appropriate permissions, and a certificate PEM file containing both private key and certificate.
Setup
Copy the environment template and configure your credentials:
cp .env.example .env
Then update your promptfooconfig.yaml with your SharePoint URL:
tests: https://yourcompany.sharepoint.com/sites/yoursite/Shared%20Documents/test-cases.csv
Run the example with:
npm install
npx promptfoo@latest init --example integration-sharepoint
npx promptfoo eval
Source README
integration-sharepoint (SharePoint Integration Example)
This example demonstrates how to use promptfoo with Microsoft SharePoint to import test cases from CSV files stored in SharePoint.
Prerequisites
- Azure AD Application with certificate-based authentication
- SharePoint site with appropriate permissions
- Certificate PEM file containing both private key and certificate
Setup
Copy the environment variables template:
cp .env.example .envFill in your SharePoint credentials in
.env:SHAREPOINT_CLIENT_ID- Your Azure AD application client IDSHAREPOINT_TENANT_ID- Your Azure AD tenant IDSHAREPOINT_CERT_PATH- Path to your certificate PEM fileSHAREPOINT_BASE_URL- Your SharePoint base URL
Ensure your CSV file is in SharePoint with the following format:
language,input,__expected French,Hello world,icontains: bonjour German,I'm hungry,llm-rubric: is german Swahili,Hello world,similar(0.8):hello worldUpdate
promptfooconfig.yamlwith your SharePoint URL:tests: https://yourcompany.sharepoint.com/sites/yoursite/Shared%20Documents/test-cases.csv
Running the Example
### Install dependencies
npm install
### Scaffold the example
npx promptfoo@latest init --example integration-sharepoint
### Run the eval
npx promptfoo eval
FAQ
Common questions
Discussion
Questions & comments · 0
Sign In Sign in to leave a comment.