Automation in Windows Instances on Amazon EC2

Solution 1:

RDP is not a good choice for Windows automation.

An alternative to ssh for windows is WinRM - Windows Remote management. Powershell has built-in support for WinRM. And if you are using EC2 (not listed in the question, but the question is tagged EC2), powershell is enabled on the Amazon default windows image. You just need to open port 5985 in your security group.

There are some instructions on how to connect using powershell here: https://stackoverflow.com/questions/10237083/how-to-programmatically-remotely-execute-a-program-in-ec2-windows-instance/13284313#13284313

The alternative to SFTP for windows is CIFS (Windows file sharing), but it is not a particularly good option - the protocol is not encrypted. You can also transfer files using a powershell script - see a sample script here: http://poshcode.org/2216

If you are ok with creating your own AMI, install cygwin and its sshd server. This will give you file transfer and remote execution over ssh to your windows instance.

Solution 2:

RDP probably isn't the best way to do what you're looking for. PowerShell Remoting is probably your best method to give you a similar experience to your Linux deployment "story". You can get interactive shell sessions on remote machines or run scripts remotely.

Being used to having an SFTP server included with the Linux OS, file transfer in the Windows world is going to feel like a bit of a hack.

You can run the SMB file sharing protocol directly over the Internet, but this is generally regarded as a bit of a security risk.

The RDP protocol has file transfer capability built-in, but using an RDP client in a batch / non-interactive manner is going to be a dodgy hack (not to mention that the file transfer mechanism in RDP is, itself, a bit of a dodgy hack).

Powershell itself can download files from remote servers in a manner similar to wget. I don't do any code deployments to remote Windows servers in my work, but I'd strongly look at using this method to "pull" code out to the remote servers if I was since it uses only built-in functionality.

Solution 3:

It's not clear if you are trying to automate the infrastructure as well as the WCF service deployment.

Code deployment

On Windows there are a couple of ways, no magic answer though I'm afraid, and the architecture is no different from Linux. The tools you use and which ones are available on Windows out of the box is where the differences are.

1) Install one of SSH, SFTP, Telenet etc. and then use similar methods as you do now on Linux together with either batch or powershell. As Evan Anderson says, may be this feels weird to you because of the tools available on Linux.

If you've worked with Java then the generic process is the same i.e. code needs to be built before deploying and all can be automated using batch script or powershell.

2) The more scalable method is to use an automated deployment server such as Octopus (as an agent installed on the deployment target) and optionally a build server such as Jenkins or Bamboo. Along with your code residing in a code repo such as Git you can have continuous integration and deployment or manual automated based on a particular branch in your git repo.

Again the generic process is the same as Java or some other language on Linux.