Great 👍 let’s continue the series with Part 5: using Power Automate to connect directly to Azure Blob Storage, so you can fetch, list, or download your modular PnP XML templates without involving the Function.
So far:
- Part 1 → Modular PnP export/import
- Part 2 → Azure Function orchestration
- Part 3 → Blob Storage for templates
- Part 4 → Managed Identity for security
Now let’s integrate with Power Automate, giving business users or admins the ability to retrieve, list, or even reapply templates d
Part 5: Accessing Modular PnP Templates in Blob Storage via Power Automate
So far:
- Part 1 → Modular PnP export/import
- Part 2 → Azure Function orchestration
- Part 3 → Blob Storage for templates
- Part 4 → Managed Identity for security
Now let’s integrate with Power Automate, giving business users or admins the ability to retrieve, list, or even reapply templates directly from a Flow.
1. Why Connect Power Automate to Blob Storage?
- Central access → templates stored in one container
- No developer involvement → admins can browse XMLs from a Flow
- Automation-ready → schedule downloads, backups, or re-apply templates automatically
- Governance → track changes and access via audit logs
2. Prerequisites
- Blob Storage account with container (e.g.,
templates) - Templates exported using PnP (Parts 1–3)
- Power Automate environment with access to Azure Blob Storage connector
- Appropriate RBAC role: Storage Blob Data Reader or Contributor
3. Example Flow: List and Download Templates
Step 1 – Create a Flow
- Trigger: Manual (button), scheduled, or HTTP request
Step 2 – Add Blob Storage Connector
- Action: Azure Blob Storage – List blobs
- Parameters:
- Storage account name
- Container name (e.g.,
templates)
Step 3 – Apply Filter
- Filter to only show PnP XMLs:
Name ends with .xml
Step 4 – Loop Through Files
- Use Apply to each → iterate over results
- Send filenames via email, Teams, or store in SharePoint
4. Example: Download a Template File
If you want to fetch a specific template (Fields.xml):
- Add Get blob content action
- Choose container:
templates - File path:
Fields.xml - Next step:
- Save to SharePoint library
- Attach in email
- Parse and reapply via Function
5. Advanced Scenario: Reapply Template from Power Automate
You can also combine Blob + Azure Function:
- Power Automate retrieves XML file name from Blob
- Sends it in HTTP body to CloneSPSite Function (Part 2)
- Function applies the template to SharePoint
Example HTTP body:
{
"SiteUrl": "https://yourtenant.sharepoint.com/sites/TargetSite",
"Action": "import",
"TemplateFile": "List_Projects.xml"
}
6. Best Practices
- Naming convention → store files as:
/exports/{siteName}/Fields.xml /exports/{siteName}/Lists/List_Projects.xml - Access control → restrict Power Automate connections with Azure AD conditional access policies
- Versioning → enable Blob versioning to restore older XMLs
- Audit → log template usage (download, apply) in Power Automate
✅ Key Takeaways
| Action | How it works |
|---|---|
| List templates | Power Automate calls Blob Storage List blobs |
| Download | Get blob content retrieves XML for local use |
| Automate reapply | Combine Blob + Azure Function with HTTP step |
| Governance | RBAC + versioning ensure secure lifecycle |
👉 With this setup, your PnP templates become first-class citizens in automation:
- Developers export/import via Functions
- Templates live in Blob Storage
- Admins and business users fetch or reapply them using Power Automate
