Account Security Problems

How to Configure a Service Account for OneDrive for Business Backup

Emma BrownEmma Brown Nov 4, 2026 870 views

Question details

The user needs to configure a service account for a backup utility to continuously access OneDrive for Business without authentication tokens expiring.

How to Configure a Service Account for OneDrive for Business
Product
OneDrive for Business
Device & OS
not provided
Scenario
Setting up automated backups that write data to a OneDrive for Business account.
Observed behavior
The backup utility currently uses a personal account for authentication, resulting in the OAuth token expiring every 90 days and interrupting the automated backup process.
Before you start

Ensure you have Microsoft 365 Global Administrator or Privileged Role Administrator access, as configuring application permissions and consenting to unattended service access requires elevated privileges.

Solution 1Recommended

Register an Application in Microsoft Entra ID (Azure AD) for Unattended Access

Set up an Azure AD application using the Client Credentials flow to grant your backup utility continuous access without relying on user-interactive tokens.

To avoid the 90-day token expiration associated with delegated permissions (personal user accounts), enterprise tools must use the Client Credentials grant flow. This involves registering an application in Microsoft Entra ID and granting it Application Permissions, allowing it to act as its own service entity.

1
Access Microsoft Entra admin center

Log in to the Microsoft Entra admin center with your administrator credentials and navigate to 'Identity' > 'Applications' > 'App registrations'.

2
Create a new app registration

Click 'New registration', provide a descriptive name for your backup utility, select the supported account types for your organization, and click 'Register'.

3
Assign API permissions

Go to 'API permissions' on the left menu, click 'Add a permission', select 'Microsoft Graph', and choose 'Application permissions'. Search for and select appropriate file permissions (e.g., Files.ReadWrite.All).

4
Grant admin consent

After adding the permissions, click the 'Grant admin consent for [Your Organization]' button to authorize the application to run without individual user login.

5
Generate a client secret

Navigate to 'Certificates & secrets', click 'New client secret', set an expiration period, and copy the generated secret value to input into your backup utility's configuration.

Register an Application in Microsoft Entra ID (Azure AD) for Unattended Access
Security Recommendation: Store your client secret securely. Since this application has broad access to OneDrive for Business files, restricting access using Application Access Policies is highly recommended.
Free Microsoft Office alternative

Manage Your Cloud Documents Seamlessly with WPS Office

While establishing backend service accounts for automated cloud backups, you need a highly efficient environment for your day-to-day document tasks. WPS Office provides a lightweight, robust, and completely free alternative to Microsoft Office that easily handles your local and cloud documents.

  1. 1. Download the software: Visit the official WPS website and download the free WPS Office installation package for your operating system.
  2. 2. Install and launch: Run the installer, follow the on-screen prompts to complete the setup, and launch the application.
  3. 3. Connect your cloud: Open the WPS Office dashboard, navigate to the Cloud storage section, and easily link your preferred cloud drives for direct document access.
Fully compatible with Microsoft Office formats, ensuring DOCX, XLSX, and PPTX files open perfectly.Lightweight architecture ensures fast launch times and optimal performance on any device.Built-in cloud integration allows you to save, sync, and manage files effortlessly.Features a familiar, easy-to-navigate user interface requiring zero learning curve.
microsoft office alternative - wps office

Frequently Asked Questions

Why does my OneDrive authentication token expire every 90 days?

By default, delegated user authentication tokens (OAuth) associated with personal or interactive user accounts are governed by Azure AD token lifetime policies. They typically expire around 90 days for security purposes, requiring interactive re-authentication.

Do I need a separate Microsoft 365 license for a service account?

If you use a dedicated interactive user account as a service account, it requires a standard Microsoft 365 license that includes OneDrive for Business. However, if you use an App Registration with Application Permissions (Client Credentials flow), a dedicated user license is generally not required.

Can standard Microsoft accounts be used for unattended backups?

Using standard Microsoft accounts for unattended, automated enterprise backups is not recommended. They rely on delegated permissions that enforce interactive logins, which leads to the token expiration issues. Automated tools should use Application Permissions.