add-onedrive — Claude Code skill: connects OneDrive
add-onedrive adds OneDrive for Business connector to a Power Apps code app and configures file operations.
MIT ★ 1,167 updated 2026-10-29
/plugin marketplace add microsoft/power-platform-skills
/plugin install code-apps-preview@power-platform-skillsWhat add-onedrive does
The skill checks for an existing OneDrive connection in the environment, adds the connector via pa app add data-source, and generates a TypeScript service with methods like ListFolder, CreateFile, GetFileContent. Requires Power Platform CLI (pa) and an active environment with ID in power.config.json. If no connection exists, it provides a link to create one at https://make.powerapps.com/environments/<environment-id>/connections.
After configuration, runs npm run build and checks for TypeScript errors. Updates memory-bank.md with the added connector and configured operations. The generated OneDriveForBusinessService.ts file can be large; the skill uses Grep to find specific methods.
What it helps with
- add OneDrive for Business connector to a Power Apps code app
- configure file upload and download from OneDrive
- list files in a OneDrive folder via TypeScript
- create a file in OneDrive from application code
- generate a TypeScript service for OneDrive API operations
Example prompts for the agent
- Add the OneDrive for Business connector to the app
- Set up file upload to OneDrive in the
/Documentsfolder - Generate code to list files from the OneDrive root folder
How to install add-onedrive
1Plugin marketplace
/plugin marketplace add microsoft/power-platform-skills/plugin install code-apps-preview@power-platform-skillsThis installs the whole code-apps-preview plugin with all its skills
2Skills CLI (Vercel)
npx skills add microsoft/power-platform-skills --skill add-onedrive -a claude-code3Manually: put the files in place
~/.claude/skills/add-onedrive/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/add-onedrive/
1Skills CLI (Vercel)
npx skills add microsoft/power-platform-skills --skill add-onedrive -a codex2Manually: put the files in place
.agents/skills/add-onedrive/SKILL.mdFor all projects use ~/.agents/skills/
1Skills CLI (Vercel)
npx skills add microsoft/power-platform-skills --skill add-onedrive -a cursor2Manually: put the files in place
.cursor/skills/add-onedrive/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install microsoft/power-platform-skills plugins/code-apps/skills/add-onedrive2Manually: put the files in place
.github/skills/add-onedrive/SKILL.md1Skills CLI (Vercel)
npx skills add microsoft/power-platform-skills --skill add-onedrive -a gemini-cli2Platform CLI
gemini skills install https://github.com/microsoft/power-platform-skills --path plugins/code-apps/skills/add-onedriveManually: put the files in place
.devin/skills/add-onedrive/SKILL.mdThe legacy .windsurf/skills/ path still works
Claude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
Step by step, with commands for each platform: How to install skills in Claude Code: five ways
Questions about add-onedrive
How to install add-onedrive in Claude Code?
Run /plugin marketplace add microsoft/power-platform-skills, then /plugin install code-apps-preview@power-platform-skills, then npx skills add microsoft/power-platform-skills --skill add-onedrive -a claude-code. The skill file will be at ~/.claude/skills/add-onedrive/SKILL.md.
What does add-onedrive do?
It adds the OneDrive for Business connector to a Power Apps code app, generates a TypeScript service with file operation methods, and configures upload, download, and folder creation as requested by the user.
What does add-onedrive require to work?
Power Platform CLI (pa), an active environment with ID in power.config.json, and an existing OneDrive for Business connection in that environment. If no connection exists, the skill directs you to create one via the Power Apps web interface.
Source text
SKILL.md · MIT
---
name: add-onedrive
description: Adds OneDrive for Business connector to a Power Apps code app. Use when uploading, downloading, listing, or managing files in OneDrive.
user-invocable: true
allowed-tools: Read, Edit, Write, Grep, Glob, Bash, LSP, TaskCreate, TaskUpdate, TaskList, TaskGet, AskUserQuestion, Skill
model: sonnet
---
**📋 Shared Instructions: [shared-instructions.md](${PLUGIN_ROOT}/shared/shared-instructions.md)** - Cross-cutting concerns.
# Add OneDrive for Business
## Workflow
1. Check Memory Bank → 2. Add Connector → 3. Configure → 4. Build → 5. Update Memory Bank
---
### Step 1: Check Memory Bank
Check for `memory-bank.md` per [shared-instructions.md](${PLUGIN_ROOT}/shared/shared-instructions.md).
### Step 2: Add Connector
**First, find the connection ID** (see [connector-reference.md](${PLUGIN_ROOT}/shared/connector-reference.md)):
Run the `/list-connections` skill. Find the OneDrive for Business connection in the output. If none exists, direct the user to create one using the environment-specific Connections URL — construct it from the active environment ID in context (from `power.config.json` or a prior step): `https://make.powerapps.com/environments/<environment-id>/connections` → **+ New connection** → search for the connector → Create.
```bash
pa app add data-source --connector onedriveforbusiness -c <connection-id>
```
### Step 3: Configure
Ask the user what file operations they need (list files, upload, download, create folder, etc.).
**Common operations:**
```typescript
// List files in a folder
const files = await OneDriveForBusinessService.ListFolder({
id: "root" // or folder ID
});
// Get file metadata
const metadata = await OneDriveForBusinessService.GetFileMetadata({
id: "file-id"
});
// Get file content
const content = await OneDriveForBusinessService.GetFileContent({
id: "file-id"
});
// Create file
await OneDriveForBusinessService.CreateFile({
folderPath: "/Documents",
name: "report.txt",
body: "File content here"
});
```
**Key points:**
- File and folder IDs can be obtained from `ListFolder` or `ListRootFolder`
- Use `folderPath` for creating files by path, `id` for accessing existing files
- Binary file content may need base64 encoding/decoding depending on the operation
Use `Grep` to find specific methods in `src/generated/services/OneDriveForBusinessService.ts` (generated files can be very large -- see [connector-reference.md](${PLUGIN_ROOT}/shared/connector-reference.md#inspecting-large-generated-files)).
### Step 4: Build
```bash
npm run build
```
Fix TypeScript errors before proceeding. Do NOT deploy yet.
### Step 5: Update Memory Bank
Update `memory-bank.md` with: connector added, configured operations, build status.
© Microsoft · MIT · microsoft/power-platform-skills