Blob Storage Cold-Archive Lifecycle Mover
Scheduled flow scans an Azure Blob Storage container for files older than a configurable age, copies each to a long-term archive container, deletes the original, and logs the move to a SharePoint list. Sends an Outlook summary of bytes reclaimed and files archived per run.
Provided as-is, without warranty of any kind. Review and test each pattern in a non-production environment before deploying it to live automations. See our Terms.
Overview
The Blob Storage Cold-Archive Lifecycle Mover is a scheduled Power Automate cloud flow that implements a business-owned, auditable blob-storage lifecycle policy. On a daily recurrence it lists every blob in a configured Azure Blob Storage source folder, finds any whose LastModified date is older than a configurable age threshold, copies each aged blob to a long-term cold-archive path, deletes the original (completing a move), writes a per-run HTML manifest to SharePoint as the audit trail, and emails a summary of files archived and bytes reclaimed. Why it matters: Azure's native blob lifecycle-management rules run silently server-side. This flow makes archival visible, logged, and business-owned - every move is recorded in a timestamped SharePoint manifest and surfaced in a summary email, so cleanup decisions are defensible and reversible. A guid() correlation id is stamped on both the manifest and the email so each run is traceable end-to-end. Ships Off (Stopped); going live requires only authorizing the three connections and setting the environment-variable values.
Use Case
Operations and IT teams with a landing-zone container (report drops, export dumps, scan output, rotating logs) want files older than N days moved to cheaper cold storage and out of the working set - without losing the paper trail of what moved, where, and when. Native Azure lifecycle rules do this invisibly; this flow does it on a schedule the business controls, with a SharePoint audit manifest and an email receipt for every run.
Flow Architecture
Recurrence Daily Archive Scan
Recurrence (Day / 1)Runs the archive scan on a daily schedule (frequency and interval configurable).
Initialize variables (x11)
Initialize VariableCorrelation id, storage account, source folder, destination path, age threshold, SharePoint site, log library, summary recipient, counters, and the manifest-rows accumulator.
List Source Folder
Azure Blob ListFolder_V4Lists every blob in the source folder.
Filter Aged Blobs
Query (Filter array)Keeps non-folder items older than the threshold.
For Each Aged Blob
Foreach (sequential, repetitions = 1)Iterates the aged blobs.
Copy Blob To Archive
Azure Blob CopyFile_V2Copies the blob to the archive path (overwrite).
Delete Source Blob
Azure Blob DeleteFile_V2Deletes the original only after the copy succeeds.
Increment Archived Count
Increment Variable+1 to the file tally.
Add To Bytes Reclaimed
Increment Variable+= this blob's Size.
Append Manifest Row
Append to String VariableAdds an HTML row describing the blob.
Environment Variables
| Schema name | Type | Default | Description |
|---|---|---|---|
| flowlibs_ArchiveStorageAccount | String | your-org-archive | Azure Blob storage account name (the dataset for all blob ops). |
| flowlibs_ArchiveSourceFolderId | String | /active-data | Identifier of the source folder to scan (the value the Blob folder picker produces). |
| flowlibs_ArchiveDestinationPath | String | /cold-archive | Destination path aged blobs are copied to before deletion. |
| flowlibs_ArchiveAgeThresholdDays | String | 90 | Blobs older than this many days are archived. |
| flowlibs_ArchiveLogLibraryPath | String | /Shared Documents | SharePoint server-relative library path for the manifest file. |
| flowlibs_ArchiveSummaryRecipient | String | alerts@yourcompany.com | Recipient of the per-run summary email. |
| flowlibs_SharePointSiteURL | String | https://your-tenant.sharepoint.com | SharePoint site that hosts the manifest log library. |
Connectors & Connections
| Connector | API name | Actions used |
|---|---|---|
| Azure Blob Storage | shared_azureblob | ListFolder_V4 CopyFile_V2 DeleteFile_V2 |
| SharePoint | shared_sharepointonline | CreateFile |
| Office 365 Outlook | shared_office365 | SendEmailV2 |
Note — All connections are referenced as solution connection references; the flow is portable between environments as long as a connection is mapped at import time.
Customization Guide
Almost every realistic variant of this flow can be implemented by changing environment variable values. A few cases require small edits inside the flow definition — those are called out explicitly below.
- Schedule
- Change the Recurrence Daily Archive Scan frequency/interval (e.g., weekly off-hours) to match your retention cadence.
- Age threshold
- Adjust flowlibs_ArchiveAgeThresholdDays; the flow defaults to 90 days if the value is blank.
- Access tier
- The Blob connector has no SetBlobTier operation, so tiering here is a folder/container move. To force Cool/Archive tier, set the destination container default tier, or add an ARM/HTTP Set Blob Tier call after the copy.
- Selective filtering
- Add criteria to the Filter Aged Blobs Query (e.g., name prefix or extension) to archive only matching files.
- Structured log instead of a manifest file
- This flow logs via SharePoint CreateFile (a timestamped HTML manifest in a library). To log into a structured list instead, point Create Archive Log File at an existing list with CreateItem/PostItem.
- Recursion
- ListFolder_V4 lists one folder level. To mirror nested folders, iterate the returned folder items (IsFolder = true) and list each subfolder.
Key Expressions
The flow is intentionally light on Power Fx / WDL gymnastics — the heaviest expressions are the branch-name concatenation and the approval outcome check. They are listed below in the order they appear in the flow.
EXPR.01Age of a blob in whole days
Ticks math, no float-to-int issues.
EXPR.02Filter-array predicate
Non-folder AND older than threshold.
EXPR.03Archive destination path for a blob
Builds the destination path per blob.
EXPR.04Timestamped manifest file name
Names the per-run manifest file.
Customize & download
Generate a ready-to-import copy of this solution with your environment-variable values baked in — available on Base, Pro, or Team.
Upgrade to customize
Comments
Sign in to join the conversation.
Sign inNo comments yet. Be the first to share your experience with this flow.