How to cut the cost of SFTP on Azure Blob Storage
Azure bills SFTP on Blob Storage by the hour for as long as it is enabled. What that costs, what switching it off does, and three ways to keep it off.
A client needs files from a supplier, an accounts system or a bank, and the other side only speaks SFTP. You switch SFTP on for a storage account, add a local user, and the transfer works. Then SFTP stays on, and Azure bills for it every hour of every day.
This guide shows what that costs, what happens when you switch it off, and three ways to keep it on only when it is needed: by hand, on a schedule, or with a button the client presses.
What SFTP on Blob Storage costs
SFTP on Azure Blob Storage is billed by the hour for as long as it is enabled on a storage account, whether anyone connects or not. Microsoft's own SFTP how-to says as much: because SFTP incurs an hourly cost, consider disabling it when clients are not actively transferring data.
At the time of writing, the pay-as-you-go list price in UK South is £0.2288 an hour, the same for every redundancy option (Azure's Blob Storage pricing). Here is what that comes to:
| SFTP is on | Hours a month | Cost a month |
|---|---|---|
| All the time | About 730 | About £167 |
| Weekdays, 9am to 6pm | About 195 | About £45 |
| One hour each weekday | About 22 | About £5 |
Left on all year, that is about £2,000 for one storage account. The charge is per account, not per container or per user, and it sits on top of the account's normal storage, transaction and data transfer charges, which do not change. Prices differ by region and do change, so check the pricing page for yours.
What happens when you switch it off
Switching SFTP off closes the SFTP endpoint, and the hourly charge stops. Nothing else about the account changes:
- The data stays where it is. Files uploaded over SFTP are ordinary blobs, still reachable through the portal, the Blob API and anything else you already use.
- Local users stay. They are a separate setting on the account, so the same usernames, passwords and keys work when SFTP is switched back on. Try one cycle on a test account before you rely on it.
- Nobody can connect until it is back on. Switch it off only when nobody is part way through a transfer.
SFTP needs the account's hierarchical namespace to be enabled. If you have SFTP running today, it already is.
Option 1: switch it off by hand
In the Azure portal, open the storage account, select SFTP under Settings, and select Disable SFTP. The same switch from the command line:
az storage account update -g <resource-group> -n <storage-account> --enable-sftp=false
az storage account update -g <resource-group> -n <storage-account> --enable-sftp=trueSet-AzStorageAccount -ResourceGroupName <resource-group> -Name <storage-account> -EnableSftp $false
Set-AzStorageAccount -ResourceGroupName <resource-group> -Name <storage-account> -EnableSftp $trueThe permission matters if anyone other than you will do this. There is no permission for the SFTP switch on its own: it is a change to the storage account, so it needs:
Microsoft.Storage/storageAccounts/read
Microsoft.Storage/storageAccounts/writeDo not reach for the built-in Storage Account Contributor role. It can also list the account keys, which is full access to the data, and delete the account. A custom role with the two actions above is enough. Be aware that write still covers the account's other settings, such as its network rules, so it is a role for people you trust with the account, not one to hand to a client.
By hand is free and fine for a transfer that happens a few times a year. The risk is the one that caused the bill in the first place: someone forgets to switch it off again.
Option 2: a schedule
If transfers happen at known times, a schedule does the remembering. The usual shape is an Azure Automation account whose managed identity holds the custom role from Option 1, with a runbook that runs on two schedules: one to switch SFTP on before the window, one to switch it off after.
param([bool] $Enable)
Connect-AzAccount -Identity
Set-AzStorageAccount -ResourceGroupName <resource-group> -Name <storage-account> -EnableSftp $EnableA Logic App with a recurrence trigger does the same job without a script. Either way you now own a small piece of automation: its identity, its schedules for each account, and noticing when a run fails.
Schedules fail the case that causes tickets. The supplier sends the file late, or on a Saturday, the window is shut, and the client rings you to open it.
Option 3: let the client switch it
The client usually knows before you do that a transfer is coming. If they can switch SFTP on for the transfer and off again afterwards, the window matches the work, and nobody waits for you.
That means putting a button in front of them with Azure kept behind it, because the role from Option 1 is too wide to give them directly. You can build that button yourself, or use a client portal that already has one. The trade-offs are the same as for virtual machines, covered in how to let clients start and stop their own Azure VMs: who may press it, which account it acts on, a record of who did what, and who looks after it. A schedule for the regular windows plus a button for the exceptions covers most clients.
Which to choose
| Option | Who switches it | Works out of hours | What you maintain | Best for |
|---|---|---|---|---|
| 1. By hand | You | Only if you do | Nothing | A few transfers a year |
| 2. Schedule | Nobody | Only at set times | A runbook or Logic App per account | Fixed transfer windows |
| 3. Client button | The client | Yes | The button, or nothing with a portal | Transfers that do not keep to a timetable |
How Task Ember does it
Task Ember is a white-label client portal for MSPs and IT teams. Its SFTP Start/Stop product is Option 3 with Option 2 built in:
- On and off in one click. Each storage account shows whether SFTP is on, with a button to switch it.
- Schedules for regular windows. Set the days and times once, and the button covers the exceptions.
- A narrow role in Azure. You create one custom role, Task Ember Storage Controller. It can read the account, switch SFTP and manage its local users. It cannot list the account keys or delete the account.
- You decide who can press it. Clients only see the accounts you put in their workspace.
- A record. Every switch is written to the workspace's activity log.
Clients sign in to your portal, with your logo and colours. See SFTP Start/Stop and the rest of the catalogue at taskember.com/products.