Embedding SharePoint documents within Power Pages allows organizations to display, manage, and interact with files stored in SharePoint directly through a public or private portal. This is especially useful for scenarios like document sharing, policy publishing, collaboration portals, and customer-facing resource centers—all while leveraging SharePoint’s robust document management capabilities.
In this guide, you’ll learn the various methods of embedding SharePoint documents in Power Pages, security considerations, technical requirements, and practical examples.
Why Embed SharePoint Documents in Power Pages?
Although Power Pages uses Dataverse as the native storage, SharePoint is often used in parallel for managing large or structured documents. Integration benefits include:
- Centralized document management using SharePoint libraries
- Real-time access to the latest document versions
- Avoiding file size and storage limits in Dataverse
- Leveraging SharePoint security and versioning features
- Embedding files such as PDFs, Word, Excel, or PPTs
Methods to Embed SharePoint Documents
There are two main approaches to embedding SharePoint documents into Power Pages:
1. Embed via iFrame Using SharePoint Embed Links
This method allows users to directly view a SharePoint document on a web page using the document’s embed code.
Steps:
- Go to your SharePoint document library.
- Open the file you want to embed (e.g., a PDF or Word document).
- Click the “…” > Embed” or “File > Share > Embed”.
- Copy the embed HTML
<iframe>
code. - In Power Pages:
- Open the page in Design Studio
- Add an HTML/Text component
- Paste the embed code inside it
Example Embed Code:
<iframe src="https://contoso.sharepoint.com/sites/Docs/Shared%20Documents/sample.pdf" width="800" height="600" frameborder="0"></iframe>
This approach works best for public/internal documents with anonymous access or authenticated user permissions.
2. Display Files Linked from Dataverse Records (Advanced)
In more secure or dynamic scenarios, you may want to:
- Link SharePoint files to Dataverse records
- Display those links dynamically in Power Pages
- Use Dataverse-SharePoint integration
Steps:
- Enable SharePoint Integration in Dataverse
- Go to Power Apps > Settings > Document Management
- Enable SharePoint integration
- Select site URL where documents will be stored
- Enable for specific tables (e.g., Account, Case)
- Upload Documents via Dynamics/Dataverse
- Navigate to a record in Dynamics 365 or Power Apps
- Use Documents tab to upload to the connected SharePoint folder
- Display SharePoint Document Links in Power Pages
- Add a Web File or Entity List to show URLs or file names
- Customize with Liquid or JavaScript for improved styling
- You can also embed SharePoint document viewers with dynamic URLs
Ensure that permissions are properly configured on both SharePoint and Power Pages.
Authentication and Access
Accessing SharePoint documents from Power Pages requires careful planning, as Power Pages users are typically external to your organization.
Options:
Scenario | Authentication Required | Notes |
---|---|---|
Public documents | None | Suitable for anonymous users |
Internal access | Azure AD / SharePoint permissions | Users must be internal or B2B guests |
External users | Azure AD B2C + Graph API | Complex, needs token-based access or proxy pattern |
If your documents are sensitive, do not rely on public links. Use SharePoint’s permission model with token-based API integration or Azure AD B2B where appropriate.
Best Practices for Embedding SharePoint Documents
- Use iFrame embedding only for public or semi-public documents
- For secure documents, consider using Power Automate or custom APIs to retrieve and serve document links securely
- Regularly audit SharePoint permissions and sharing settings
- Use responsive design to make embedded files mobile-friendly
- Store metadata about documents in Dataverse to allow filtering/sorting
Sample Use Cases
1. Knowledge Base Portal
- Display downloadable PDFs of manuals or guides stored in SharePoint
2. Policy Portal
- Embed Word or PDF documents of company policies for employees or clients
3. Customer Resource Center
- Link support documents to case records dynamically via Dataverse
4. Vendor/Partner Portal
- Allow partners to view or download project files, invoices, and contracts
Security Considerations
- Always validate the visibility of SharePoint documents before embedding
- For portals accessible to external users, avoid exposing internal SharePoint URLs
- Use Azure AD B2B or token-based access for secure document embedding
- Consider proxying document access through Azure Functions or custom APIs
Limitations
- Direct embedding is only ideal for public documents
- SharePoint embed URLs may not work in all browsers or for all users
- There’s no native document viewer component in Power Pages—you’ll need to use iframe or third-party viewers