How to move cold files off Azure Files without losing them
Azure Files bills old files at the same rate as new ones. What cold files cost, why Azure has no rule for it, and how to move them to Blob storage safely.
Most file shares are mostly old files. Last year's projects, a leaver's folder, scans nobody has looked at since they were saved. On Azure Files every one of them is billed at the same rate as the spreadsheet someone opened this morning.
This guide shows what that costs, why Azure has no built-in rule to fix it, how to move cold files to cheaper Blob storage by hand, and what to get right before you delete anything from a client's share.
What cold files cost on Azure Files
A standard Azure file share has one access tier, chosen for the whole share: transaction optimized, hot or cool (Microsoft's Azure Files billing page). Blob storage has cheaper tiers again, set on each file. At the time of writing, the pay-as-you-go list prices for locally redundant storage in UK South are:
| Where the files sit | Per GB a month | 1,000 GB a month |
|---|---|---|
| Azure Files, premium (billed on provisioned size) | £0.1342 | £134.20 |
| Azure Files, transaction optimized | £0.0572 | £57.20 |
| Azure Files, hot | £0.0202 | £20.20 |
| Azure Files, cool | £0.0120 | £12.00 |
| Blob storage, cool | £0.0080 | £8.00 |
| Blob storage, cold | £0.0034 | £3.40 |
| Blob storage, archive | £0.0014 | £1.40 |
So 1,000 GB of untouched files on a transaction optimized share costs about £57 a month. The same files in Blob cold storage cost about £3.40. Prices differ by region and change, so check Azure's Azure Files pricing and Blob Storage pricing for yours. These are storage prices only. Transactions and reading data back are billed on top.
Why Azure has no built-in rule for this
Two Azure features sound like the answer, and neither is:
- Lifecycle management moves files to cheaper tiers by age, but only for blobs. It does nothing for files in a file share.
- Azure File Sync cloud tiering keeps the busy files on a Windows server and leaves the rest in the Azure file share. It saves space on the server, not money in Azure: the files stay on the share at the share's rate.
You can move the whole share to the cool tier. That cuts storage to £0.012 per GB, but it applies to the files in daily use as well, which then cost more to read and write. Changing tier is also charged per file, and a share's tier can change at most five times in 30 days.
Option 1: move them by hand with AzCopy
AzCopy copies straight from a file share to a Blob container and can set the tier as it goes. To move a folder that nobody has touched in a year into the cold tier:
azcopy copy "https://<account>.file.core.windows.net/<share>/<folder>?<SAS>" \
"https://<account>.blob.core.windows.net/<container>/<folder>?<SAS>" \
--recursive --block-blob-tier=ColdThen check the copy and delete the originals. This works for a one-off clear-out. What it leaves you with:
- The files vanish from where people look. Nobody opening the share can tell the folder was moved, or ask for it back, without ringing you.
- Permissions stay behind. Blob storage has nowhere to keep a file's NTFS permissions, so a file copied back later does not get its old permissions back unless you saved them somewhere else.
- Nobody does it twice. Files go cold every month, and a manual clear-out happens once.
Choosing the Blob tier
Cheaper tiers charge more to read and expect files to stay for a minimum period. Remove or move a file sooner and you pay for the rest of that period anyway.
| Tier | Minimum stay | Getting a file back | Good for |
|---|---|---|---|
| Cool | 30 days | Straight away | Files that are still opened now and then |
| Cold | 90 days | Straight away | Files someone might want one day |
| Archive | 180 days | Up to 15 hours, or often under an hour at a higher price, for files under 10 GB | Files kept for the record and rarely asked for |
An archived file cannot be read at all until it is rehydrated. For a client who might ring up wanting a file today, cold is usually the deepest tier worth using.
What to get right before deleting anything
- Check every copy before the original goes. Compare a hash of the copy with the original, not just the size.
- Keep the permissions and dates. Store them with the copy, so a file comes back with the same access and the same modified date.
- Leave something in its place. A shortcut where the file was tells people it was moved and how to get it back.
- Snapshot the share first. A share snapshot before each run means a bad run can be undone.
- Leave recent changes alone. Go by when a file was last changed, and skip anything changed recently.
- Do not archive a file someone just brought back. If it goes straight back to the archive, they ask again next week and you pay the minimum stay twice.
- Run out of hours. Moving files is quiet work best done overnight.
- On premium shares, shrink the share afterwards. Premium is billed on the size you provision, so moving files out saves nothing until you lower it.
Which to choose
| Approach | What it saves | What it costs you | Best for |
|---|---|---|---|
| Move the whole share to cool | Storage on every file | Dearer reads and writes on busy files | Shares that are almost all old |
| AzCopy by hand | Storage on the files you move | Your time, and files people cannot find | A one-off clear-out |
| An archive tool with shortcuts | Storage on every file that goes cold, every month | The tool | Shares that keep growing |
How Task Ember does it
Task Ember is a white-label client portal for MSPs and IT teams. Its Ember Archive product moves cold files off Azure Files and keeps them one click away:
- A scan before anything moves. It shows how much of the share is eligible and what moving it would save.
- A policy you set. Ages for cool, cold and archive (90, 180 and 365 days since a file was last changed, by default), the deepest tier you allow, folders to skip, and folders that move as one.
- Runs on a schedule, overnight by default, with a snapshot of the share taken first so a run can be rolled back.
- Checked before removed. Each copy is checked against a SHA-256 hash before the original is deleted, and permissions and timestamps travel with the file.
- A shortcut where the file was. Opening it brings people to a page in the portal, where members with recover permission bring the file back. A recovered file stays put for 30 days before it can be archived again.
- The client's own storage. Archived files sit in a Blob container in the client's subscription, and the workspace shows the Azure saving, Ember Archive's price and what is left, side by side.
See Ember Archive and the rest of the catalogue at taskember.com/products.