SFTP is a feature available on Azure Blob Storage. This can be enabled or disabled at any point of time after the creation of the storage account. By enabling SFTP, the storage account gets a public endpoint for the SFTP connectivity. This comes with an additional cost beyond the usual cost for the data storage (read, write and storage). The cost for SFTP is charged on hourly basis. So if you turn it on for a longer period without usage, you will waste a lot of money.
My recommendation is to enable the SFTP whenever needed. This can be enabled in several ways
From the Azure web portal in a single click
Using Azure CLI
Using Azure API or SDKs
Here I am explaining a simple way to enable or disable the SFTP using a python program. This program uses a service principle which has Contributor access to the storage account.
The following packages are the dependencies for this program.
Note:Update the variables with the values specific to your Azure account and Service principle before executing this program.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This program can be scheduled using a scheduler to enable / disable the SFTP based on your schedule and save some cost. There are schedulers available within Azure itself.
I hope this article is useful. Feel free to comment below this post if you have any questions or feedback.