logo
search
File Sharing Problems

How to Embed a Shared OneDrive Folder on an Azure Website

Maira MehtabMaira Mehtab Sep 21, 2026 868 views

Question details

The user needs to provide authenticated website visitors access to an entire shared organizational OneDrive folder hosted on an Azure website.

Product
OneDrive / Azure
Device & OS
not provided
Scenario
Developing or managing an Azure-hosted web application that requires displaying a complete OneDrive folder directory to authenticated users.
Observed behavior
While individual OneDrive files can be embedded via iframe, OneDrive does not natively support embedding an entire folder directly into a webpage.
Before you start

Ensure you have administrative access to your Azure portal, the Microsoft Entra ID (Azure AD) application registrations, and the organizational OneDrive account with appropriate sharing permissions.

Solution 1Recommended

Use a Direct Link to the Shared OneDrive Folder

Since native embedding of folders is not supported, providing a direct, authenticated link to the folder is the simplest and most reliable workaround.

1
Generate the Sharing Link

Navigate to the organizational OneDrive online portal, locate the target folder, click the 'Share' icon, and configure the link settings to allow access for your authenticated users.

2
Copy the Link URL

Click 'Copy Link' to generate the URL for the folder.

3
Add the Link to Your Azure Website

Insert a hyperlink or a styled button in your website's HTML code (e.g., <a href="[URL]">Open Shared Folder</a>) directing users to the OneDrive folder.

Free Microsoft Office alternative

Need a Lightweight Office Alternative? Try WPS Office

While integrating complex Microsoft APIs like OneDrive and Azure requires development effort, choosing your daily productivity software should be simple. WPS Office is a highly compatible, free alternative to Microsoft Office that meets all your document editing needs.

  1. 1. Download WPS Office: Visit the official WPS website and download the installation package for your operating system.
  2. 2. Install the Application: Run the installer and follow the on-screen prompts to set up WPS Office on your device.
  3. 3. Open Your Documents: Launch WPS Office and instantly open your existing .docx, .xlsx, and .pptx files with full formatting support.
Free, lightweight, and easy to deploy on any system.Fully compatible with Microsoft Word, Excel, and PowerPoint formats.Built-in cloud storage options for easy and secure file sharing.Familiar user interface requiring zero learning curve for rapid migration.
microsoft office alternative - wps office

Frequently Asked Questions

Can I embed a single OneDrive file instead of an entire folder?

Yes, OneDrive natively supports embedding individual files such as Word documents, Excel spreadsheets, and PowerPoint presentations. You can generate an embed code directly from the OneDrive web interface by right-clicking the file and selecting 'Embed'.

Why doesn't OneDrive allow folder embedding directly via iframe?

Microsoft currently restricts folder embedding primarily for security, authentication, and cross-site scripting (XSS) prevention reasons. Browsing a directory requires active session tokens that do not seamlessly pass through standard iframe embeds.

Is it safe to use Microsoft Graph client secrets in my website's JavaScript?

No, it is highly insecure to expose client secrets in client-side code (like JavaScript running in the browser). Malicious users can easily extract these secrets and gain unauthorized access to your organization's data. Authentication should always occur on a secure backend server.