Microsoft MVPDNN MVPXamarin Certified
I'm Andrew Hoefling, and I work for FileOnQ as a Lead Software Engineer building mobile technologies for Government, Financial and First Responders using Xamarin.
VSTS and Azure go so well together, any project is just a few key strokes away from deploying source code out to the cloud. Sometimes we don't have the luxury of working in Azure and we need to use VSTS to securely deploy code out to any server. WIth the ease of built in scripts to VSTS and powershell access you can start deploying to IIS just as easy as Azure.
To deploy code from VSTS to your custom server you need to install a special VSTS service that runs on that server that is listening for VSTS code pushes. This securely communicates with VSTS using a Personal Access Token or PAT so it is easy to lock down this connection and turn it off if you ever need to.
Let's begin by installing the VSTS agent on our Server. There is nothing I need to memorize or custom script I need to write. Just follow these steps and VSTS will generate the correct script for you.
Our Windows Server is technically a Deployment Group as far as VSTS is concerned. The idea at this point is create your Deployment Group and run the generated script.
The script will prompt you for a few things:
The Agent is installed on your Windows Server and you don't need to do anything else to get VSTS to communicate with it. The Agent will run in the background and starts automatically, so it is truly just a set it and forget it. You can always view the Agent Health from VSTS to see if the 2 servers are communicating correctly
Let's make a new build that will deploy our code out to our Windows Server. You will do this the same way you would with any build except the deployment portion is going to be different. We are going to assume you already have a CI build that generates the correct artifacts and we are working in a Release Build
Once we get our Release Build configured, we are going to start by updating our default empty pipeline by:
Since we aren't deploying to Azure and our Windows Server we need to specify the Deployment Group instead of the Agent Phase.
Follow the steps below to add in our Deployment Group and add our build steps
Now that the Phase is properly added we can start adding the tasks to deploy the code.
At this point we can test our build and deployment, which should be deploying our Web App onto our custom Windows Server.
It is really easy to setup VSTS to deploy code out to any custom Windows Server that you would like to integrate with. This is not the only way to integrate a server with VSTS as the Agent supports many operting systems.