OneDrive integration for WordPress backups requires significantly more setup complexity than other cloud providers. While Dropbox and Google Drive offer simple OAuth connections, OneDrive demands Azure Portal app registration, Microsoft Graph API configuration, proper permission scopes, and redirect URI setup—all before your first backup can upload.
This advanced guide walks through complete OneDrive configuration from scratch: registering applications in Microsoft Azure Portal, configuring Microsoft Graph API permissions, creating client credentials, setting up OAuth 2.0 authentication flows, understanding Personal vs Business account differences, implementing resumable uploads for large files, and troubleshooting Microsoft-specific authentication challenges.
OneDrive provides attractive pricing (1 TB for $6.99/month with Microsoft 365 subscription) and seamless integration with Microsoft ecosystem, making setup complexity worthwhile for organizations already using Microsoft services. By the end, you’ll have fully functional OneDrive backup storage with automatic uploads and reliable resumable transfer sessions
What You’ll Learn
- Registering app in Microsoft Azure Portal
- Configuring Microsoft Graph API permissions
- Creating client credentials
- Setting up OAuth 2.0 authentication
- Connecting Backup Copilot Pro to OneDrive
- Personal vs Business account differences
- Managing resumable uploads
- Troubleshooting Microsoft authentication
Prerequisites
Microsoft Account Types
OneDrive Personal: Consumer Microsoft accounts (outlook.com, hotmail.com, live.com). Comes with 5 GB free storage, upgradeable to 100 GB ($1.99/month) or 1 TB with Microsoft 365 ($6.99/month). Suitable for personal blogs, small sites, individual developers.
OneDrive for Business: Part of Microsoft 365 Business subscriptions. Starts at 1 TB per user, expandable to unlimited with proper licensing. Integrated with SharePoint Online. Suitable for corporate environments, agencies, enterprise deployments. Requires organization administrator setup.
Key Differences: Personal accounts authenticate directly via consumer Azure AD. Business accounts use organization-specific Azure AD tenants. API endpoints and authentication flows differ slightly. This guide covers both, noting differences where applicable.
Understanding Microsoft Graph API
Microsoft Graph API is Microsoft’s unified REST API for accessing Microsoft 365 services including OneDrive, SharePoint, Outlook, Teams. For backup purposes, you’ll use OneDrive-specific endpoints:
Upload Operations:
PUT /me/drive/items/{parent-id}:/{filename}:/content– Simple upload (< 4 MB files)POST /me/drive/items/{parent-id}:/{filename}:/createUploadSession– Resumable upload (large files)PUT {uploadUrl}– Upload chunks to resumable session
File Operations:
GET /me/drive/root:/backups– List backup folder contentsGET /me/drive/items/{item-id}/content– Download backup fileDELETE /me/drive/items/{item-id}– Delete old backup
Permissions Required:
Files.ReadWrite– Read/write access to user filesFiles.ReadWrite.All– Read/write access to all files (Business accounts)offline_access– Refresh token support for long-term access without re-authentication
Storage Considerations
OneDrive Personal Quotas: 5 GB free, 100 GB ($1.99/month), 1 TB with Microsoft 365 ($6.99/month including Office apps). Sites with 2 GB backups can store ~500 GB worth (250 backups with 30-day retention) on 1 TB plan.
OneDrive for Business Quotas: Default 1 TB per user. Organizations with 5+ users can request unlimited storage. Quotas managed by tenant administrators. Storage doesn’t count against individual user quotas when uploaded via Service Principal.
Upload Limits: Single file size limit: 250 GB for personal, 100 GB for business (via web interface), essentially unlimited via API with resumable uploads. Session timeout: 24 hours. Chunk size: 5-10 MB recommended (minimum 320 KB, maximum 60 MB).
Azure Portal Access
Navigate to https://portal.azure.com and sign in with Microsoft account. Personal accounts gain immediate access to Azure Active Directory application registration. Business accounts require appropriate permissions from tenant administrator (Application Developer or Application Administrator role).
If using personal account: No additional setup required—proceed directly to app registration. If using business account: Ensure your organization’s Azure AD tenant allows user app registrations, or request admin to register app on your behalf
Registering Your Application in Azure
Complete Azure app registration creates the credentials Backup Copilot Pro needs to authenticate with OneDrive.
Step 1: Access Azure Portal – Navigate to https://portal.azure.com, sign in with Microsoft account. Dashboard displays Azure services.
Step 2: Navigate to App Registrations – Click “Azure Active Directory” in left sidebar (or search “Azure Active Directory” in top search bar). In Azure AD overview, click “App registrations” in left menu under “Manage” section.
Step 3: Register New Application – Click “New registration” button at top. Fill registration form:
- Name: “WordPress Backup Copilot Pro” (or any descriptive name)
- Supported account types: Choose “Accounts in any organizational directory and personal Microsoft accounts” for maximum compatibility
- Redirect URI: Select “Web” platform, enter
https://yourdomain.com/wp-admin/admin.php?page=backup-copilot-pro&tab=cloud(replace yourdomain.com with actual domain)
Click “Register” button. Azure creates application and displays application overview page.
Step 4: Note Application (Client) ID – Overview page displays “Application (client) ID” – a GUID like 12345678-1234-1234-1234-123456789abc. Copy this ID—you’ll enter it in Backup Copilot Pro settings. Also note “Directory (tenant) ID” if using Business account.
Creating Client Secret
Client secret acts as password allowing Backup Copilot Pro to authenticate as registered application.
Step 1: Navigate to Certificates & Secrets – In application page, click “Certificates & secrets” in left menu under “Manage” section.
Step 2: Create New Client Secret – Under “Client secrets” tab, click “New client secret” button. Configure secret:
- Description: “WordPress Backup Plugin” (identifies purpose)
- Expires: Choose expiration (6 months, 12 months, 24 months, or custom). Longer duration means less frequent renewals but potentially increased security risk if leaked.
Click “Add” button. Azure generates client secret.
Step 3: Copy Secret Value – Client secret appears with Value column showing generated secret string (40+ character alphanumeric string). CRITICAL: Copy this value immediately—it’s shown only once. After leaving page, Azure permanently hides value for security. If lost, you must create new secret.
Step 4: Store Credentials Securely – Store Client ID and Client Secret in password manager or secure documentation. You need both values to configure Backup Copilot Pro OneDrive connection. Never commit these to public repositories or share publicly—they grant access to your OneDrive.
Configuring API Permissions
Permissions determine what Backup Copilot Pro can access in your OneDrive.
Step 1: Access API Permissions – In application page, click “API permissions” in left menu under “Manage” section. Default shows “Microsoft Graph” permission “User.Read” (basic profile access).
Step 2: Add Microsoft Graph Permissions – Click “Add a permission” button. Select “Microsoft Graph” from list. Choose “Delegated permissions” (permissions acting on behalf of signed-in user).
Step 3: Configure Delegated Permissions – Search for and select these permissions:
- Files.ReadWrite: Read and write files in user’s OneDrive
- Files.ReadWrite.All: Read and write all files user can access (required for Business accounts with shared folders)
- offline_access: Maintain access to data granted consent to (allows refresh tokens to work indefinitely)
Click “Add permissions” button. Permissions appear in API permissions list.
Step 4: Grant Admin Consent (Business accounts only) – Some organizations require administrator consent before apps can access data. If you see warning “Not granted for [organization]” with yellow alert icon, click “Grant admin consent for [organization]” button. Requires Global Administrator or Application Administrator role. After granting, status changes to green checkmark “Granted for [organization]”.
Personal accounts don’t require admin consent—users grant consent when first authenticating.
Setting Up Redirect URIs
Redirect URI is where Microsoft sends users after authentication. Must match exactly what Backup Copilot Pro expects.
Step 1: Navigate to Authentication – In application page, click “Authentication” in left menu under “Manage” section.
Step 2: Add Platform (if not done during registration) – If no platforms configured, click “Add a platform” button, select “Web”.
Step 3: Configure Web Platform – Add redirect URI: https://yourdomain.com/wp-admin/admin.php?page=backup-copilot-pro&tab=cloud
Important: Use exact WordPress admin URL. If WordPress installed in subdirectory (https://example.com/blog/), include it: https://example.com/blog/wp-admin/admin.php?page=backup-copilot-pro&tab=cloud. HTTPS required (http:// redirects won’t work unless explicitly enabled for development).
Step 4: Additional Configuration – Under “Implicit grant and hybrid flows”, ensure nothing is checked (Backup Copilot Pro uses authorization code flow, not implicit flow). Save configuration.
Connecting Backup Copilot Pro to OneDrive
Step 1: Enter Client Credentials – In WordPress admin, navigate to Backup Copilot Pro → Settings → Cloud Storage → OneDrive. Enter Application (Client) ID from Azure Portal. Enter Client Secret value copied earlier. Click “Save Settings”.
Step 2: Initiate Connection – Click “Connect to OneDrive” button. Plugin redirects to Microsoft login page.
Step 3: Microsoft Authorization – Sign in with Microsoft account (same account used for Azure registration). Microsoft displays consent screen listing permissions application requests (Files.ReadWrite, offline_access).
Step 4: Grant Permissions – Review requested permissions. Click “Accept” to grant consent. Microsoft redirects back to WordPress admin with authorization code in URL.
Step 5: Verify Connection – Plugin exchanges authorization code for access token and refresh token automatically. Success message displays: “OneDrive connected successfully.” Green checkmark appears next to OneDrive in cloud storage list. Current storage quota displays (e.g., “457 GB of 1 TB used”).
Personal vs Business Accounts
OneDrive Personal: Consumer accounts authenticate via common Azure AD endpoint (login.microsoftonline.com/common). Files stored in personal OneDrive root. API permissions: delegated user permissions only. Storage quota tied to Microsoft 365 subscription level.
OneDrive for Business: Organization accounts authenticate via tenant-specific endpoint (login.microsoftonline.com/{tenant-id}). Files can be stored in user OneDrive or SharePoint document libraries. API permissions: can use application permissions for unattended access. Storage quota managed by tenant administrator.
SharePoint Integration: Business accounts can store backups in SharePoint document libraries instead of personal OneDrive. Provides better team collaboration, retention policies, compliance features. Configure by selecting SharePoint site and library in plugin settings.
API Behavior Differences: Personal accounts use simpler authentication flow. Business accounts support richer permission models, SharePoint integration, and tenant-wide policies. Upload endpoints identical—Microsoft Graph API abstracts differences.
Configuring Upload Settings
Resumable Upload Configuration: Backups >4 MB automatically use resumable uploads (Microsoft Graph requirement). Plugin creates upload session, uploads file in chunks, monitors session status. Sessions expire after 24 hours of inactivity—plugin renews automatically if upload takes longer.
Chunk Size: Default 10 MB chunks balances speed and reliability. Configurable from 5-60 MB. Smaller chunks (5 MB) better for unstable connections with frequent retries. Larger chunks (60 MB) faster for stable high-bandwidth connections.
Folder Organization: Configure OneDrive folder path for backups. Default: /Backups/WordPress/. Plugin creates folders automatically if they don’t exist. Supports subdirectories for organizing multiple sites: /Backups/Site1/, /Backups/Site2/.
Automatic Upload Options: Enable “Upload after backup” to automatically upload new backups to OneDrive. Disable for manual uploads only. Configure upload schedule (immediate, hourly delay, overnight only) to control bandwidth usage.
Testing OneDrive Integration
Manual Upload Test: Create test backup → Navigate to Backups list → Select backup → Click “Upload to OneDrive”. Progress bar shows upload status. Success notification appears when complete.
Verifying Files in OneDrive: Open OneDrive.com in browser, navigate to configured backup folder (/Backups/WordPress/). Backup files appear with .zip extension and timestamp. File sizes match local backup sizes (compressed).
Download Test: In Backup Copilot Pro, select OneDrive backup → Click “Download from OneDrive”. Plugin downloads file and verifies integrity (checksum validation). Confirms OneDrive connectivity works bidirectionally.
Troubleshooting Common Issues
“Invalid Client” Error – Cause: Client ID incorrect or application deleted in Azure. Solution: Verify Client ID copied correctly from Azure Portal Application Overview page. Confirm application still exists in Azure App Registrations.
“Unauthorized Client” Error – Cause: Client Secret expired or incorrect. Solution: Generate new client secret in Azure Portal → Certificates & Secrets. Update secret in plugin settings. Secrets expire per configured duration—renew before expiration.
Token Refresh Failures – Cause: Refresh token invalid or revoked. User revoked application access. Solution: Disconnect and reconnect OneDrive in plugin settings. Grants fresh tokens. Check Azure Portal → Enterprise Applications for revoked consent.
Upload Session Expiration – Cause: Upload took >24 hours or network interruption. Solution: Plugin automatically retries with new session. For very large backups (100+ GB), ensure stable internet connection. Consider splitting into smaller backups.
Redirect URI Mismatch – Cause: Redirect URI in Azure doesn’t match actual WordPress admin URL. Solution: Update redirect URI in Azure Portal → Authentication to exactly match WordPress URL (including https://, domain, and query parameters).
API Rate Limiting – Cause: Too many API requests in short time. OneDrive limits: 10,000 requests per user per 600 seconds. Solution: Plugin implements exponential backoff automatically. For multiple sites, stagger backup schedules to avoid simultaneous uploads.
Permission Errors – Cause: Required permissions not granted. Business account requires admin consent. Solution: Verify Files.ReadWrite and offline_access permissions granted in Azure Portal → API Permissions. Business accounts: have administrator grant consent.
Security Best Practices
Securing Client Credentials: Store Client ID and Secret in encrypted WordPress options table (Backup Copilot Pro handles this automatically). Never commit credentials to version control. Use environment variables for credentials in development environments.
Token Storage Security: Access and refresh tokens encrypted before database storage. Tokens automatically rotated—refresh token exchanges for new access token hourly. Never log or expose tokens in debugging output.
Revoking Application Access: Users can revoke access anytime: OneDrive.com → Settings → Apps & Services → Remove WordPress Backup Copilot Pro. Azure Portal → Enterprise Applications → [Your App] → Delete. Plugin detects revoked access and prompts reconnection.
Monitoring API Usage: Monitor upload frequency and file sizes to stay within OneDrive quotas. Enable email notifications for failed uploads indicating potential security issues (token compromise). Review Azure Portal audit logs for unexpected API activity.
Microsoft 365 Integration
Organizations with Microsoft 365 can integrate backups with broader compliance and retention strategies. OneDrive for Business supports: Retention policies (automatically keep backups minimum periods), eDiscovery (include backups in legal hold), DLP policies (prevent backup files from external sharing), Audit logs (track all access to backup files). Configure via Microsoft 365 Compliance Center—policies automatically apply to backup files stored in OneDrive/SharePoint
Relevant External Links
- Microsoft Azure Portal
- Microsoft Graph API Documentation
- Register an Application with Azure AD
- OneDrive API Reference
- Microsoft Graph Permissions Reference
Call to Action
Simplify OneDrive backups! Backup Copilot Pro includes OneDrive integration with automatic setup, resumable uploads, and full support for personal and business accounts!

