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

  1. Blob Storage account with container (e.g., templates)
  2. Templates exported using PnP (Parts 1–3)
  3. Power Automate environment with access to Azure Blob Storage connector
  4. 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):

  1. Add Get blob content action
  2. Choose container: templates
  3. File path: Fields.xml
  4. 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:

  1. Power Automate retrieves XML file name from Blob
  2. Sends it in HTTP body to CloneSPSite Function (Part 2)
  3. 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

ActionHow it works
List templatesPower Automate calls Blob Storage List blobs
DownloadGet blob content retrieves XML for local use
Automate reapplyCombine Blob + Azure Function with HTTP step
GovernanceRBAC + 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
Edvaldo Guimrães Filho Avatar

Published by