SFTP with Microsoft Azure VM and WinSCP

This is a guide in creating an SFTP server with Microsoft Azure VM. This article also shows how to connect to it through WinSCP and the generated code to integrate with your .Net applications.

Provisioning an Azure VM

In the Home page of the Azure Portal, Create a resource > Search for Ubuntu Server > Create

Enter the VM’s Basic settings.

In Administrator account, choose Password as Authentication Type.

Note that you can also choose SSH public key, but my reason for choosing password is that, I don’t want to pass my SSH private key around to the users that need to connect to the VM, to minimize the risk of getting it at the wrong hands and mess up with it.

Configure the other settings of the VM, go ahead and create it and wait for the deployment to be completed.

Connecting to the SFTP server using WinSCP

Once the VM is created, grab the Public IP address from the VM Overview.

Open WinSCP > New Session > New Site > Enter the VM’s details > Login

A warning modal will pop up asking you if you trust the host, as you’ll be communicating through it directly through TCP port 22 (SSH), it will also show the SSH Host Key Fingerprint in SHA-256 and MD5 encryption. Choose Yes.

Once connected, you can now transfer files from your PC to the SFTP server, vice versa.

To get the generated code for .Net applications integration, Go to Session > Generate Session URL/Code > .Net assemby code

Note that you’ll need to install the .