Following this template I was able to create a powershell script that when ran in the portal would deploy new instances of SFTP by connecting to our storage account and creating one share per user. This works great as a one off solution to have user’s send you files and each user is to have their own chroot. Source is maintained at Github here.
The way to use is:
- Download from my Github
p.jsonwith your info. Replace
run.ps1with your info. Look over
t.jsonbut I’m sure you don’t have to change anything in there.
- Upload to your Azure Cloud Storage by going to portal.azure.com => Click on powershell icon => Once you sign in =>
cd ./clouddrive/yournameand then upload all three files into a folder
- Then run
./run.ps1and it will deploy the containers
- Go to Azure Container Instances to see the result!
run.ps1in cloud shell and paste in this
Create the template file
t.jsonand paste in this
Create the parameters file
p.jsonand paste in this
What I do is keep these three files in a folder, and when needed copy the folder, rename it, tweak parameters, and deploy again for each department in my org that needs a SFTP folder to upload to.