The installation of Windows application can be automated using AutoHotkey (AHK), similar as Winetricks does this for all common apps which support.
Here is example of AHK script which aims to install mentioned application:
WinWait, MetaTrader 5 Setup
WinWait, MetaTrader 5 Setup, ...
Infrastructure as code means that the infrastructure configuration is stored in a version control system (VCS). If changes will be applied, it is traceable who changed the code and when.
Although it is unclear to me what the aim is of your question, it is possible to use a continuous integration (CI) tool like, Jenkins, gitlab, circleci that pulls the code ...
So it actually only took one line of code:
1) First take the SSH public key from the settings page inside the appveyor project and make sure you put it into the authorized_keys inside user_that_you_are_going_to_login_with_from_appveyor/.ssh/authorized_keys
2) To clear the folder before deploying to it on a Ubuntu server
ssh user@host -...
WebDeploy by itself cannot guarantee if your application pool will not be recycled during deployment. To be on the safe side, I would use deployment slots.
Also I would recommend to tag question with azure-web-sites so right people will help you.