Setup CI Environment Using TFS and Amazon EC2 - visual-studio

Can someone recommend a good approach for setting up a CI environment that would deploy to a multiple websites (QA/PROD) hosted on Amazon's EC2 while using TFS?
Here are the requirements I'm looking to fulfill:
Have TFS deployed somewhere to track tasks, manage source control, run tests on code check-in and do automatic deployments to a QA environment.
If everything passes the CI build in TFS, code should be automatically deployed to a QA environment hosted in Amazon EC2.
After testing, take the same deployment package we used for the QA environment and push it to an identical environment in EC2 which is our production environment.
We are a start-up so we don't need all the of bells and whistles just yet. We have limited resources currently so I am trying to be as minimal as possible while meeting the above requirements.
My first pass at this was to use the free program at Amazon for first-time users to have access to the EC2 cloud for free for 12 months. Then to setup a virtual machine at a low cost (~$20) with a web host to host our TFS environment which would then push to the Amazon cloud.
We also considered using "Visual Studio Online" to do this but it looks like it only deploys to Azure which is a little more than twice the cost to host a website with SQL on than Amazon so we don't want to go that route.
Is this a good approach? I'd appreciate any feedback. Thanks!

Using the latest TFS vNext build system this should be possible. You would need to install the AWS command line tools via npm, load your credentials, and then use aws command line to deploy to ec2.
Here is a screen shot of adding an npm task. Install the aws command line sdk. Run commands to package and upload your project.

You should install Release Management for Visual Studio 2013. It is easy to install and comes with your MSDN.
http://nakedalm.com/install-release-management-2013/
With it you can create a release pipeline with rollback to deploy your application. You will likely need to add any command line tools that you need to deploy to amazon and it will make sure they get to where they need to be.
http://nakedalm.com/building-release-pipeline-release-management-visual-studio-2013/

Related

Is it possible to manually run a build on a local Azure build agent without a DevOps server?

We normally use on-premises Azure DevOps Server to maange our build pipelines, using YML files. We have build agents running on one or more build servers.
A specific piece of R&D would be made far easier if we could install VS and a build-agent on a standalone box which is not linked to the Azure DevOps server, and manually 'run an YML build' against the build agent locally.
We don't have access to DevOps server from this machine and the alternative is rescripting an alternative to our YML in Powerscript or similar.
Is there any realistic way to do this?
Is it possible to manually run a build on a local Azure build agent without a DevOps server?
I am afraid there is no such way to manually run a build on a local Azure build agent without a DevOps server.
That's because azure devops services/server is equivalent to an interpreter and trigger. Agent itself is not a program that can be executed independently like MSBuild.exe, it does not have the ability to parse YAML grammar, it can only execute the parsed command passed by the server.
I totally understand your needs and approve of it, so I recommend you add your request for this feature on our UserVoice site (https://developercommunity.visualstudio.com/content/idea/post.html?space=21 ), which is our main forum for product suggestions:

How do I deploy a .net Core App from my Mac to Amazon AWS (Ubuntu)

I've created an C# app on my Macbook using Visual Studio Community edition, and would now like to deploy it on AWS.
While I could setup a windows machine on AWS, I want to challenge myself and try it on Linux.
Although I see a lot of tutorials saying you need to setup core yourself on the server, I think this is no longer necessary as it appears AWS can set this all up for you:
AWS Image:
So assuming I just do that, and now I have my server up, what happens next?
I know that I could use puTTY or FTP or something to move the files to the server, but is that the recommended approach? I read you can use 'dotnet publish" with arguments to create the package to deploy but still seems a bit archaic and time-consuming unless I make a script. Visual Studio for Windows allows much more robust publishing options, such as publishing directly to the server, but for Mac, what are the options to do this in a more robust fashion? What are others doing?
Thanks so much!
https://learn.microsoft.com/en-us/aspnet/core/host-and-deploy/linux-nginx?view=aspnetcore-2.1&tabs=aspnetcore2x
A good way of getting your code inside is SSH and git clone your repository.

Why is latest Xamarin needed on local TFS server for CI?

The requirements on the following page state that you need to install Visual Studio with Xamarin on your local TFS server to setup Xamarin CI builds:
https://developer.xamarin.com/guides/cross-platform/ci/intro_to_ci/
topography of the CI
This is a real pain. We have lots of developers that rely on our local TFS server, most of whom don't do any Xamarin development. As such, any changes are heavily scrutinized. This often leads to us not installing the latest VS/Xamarin releases, as it's considered too risky for this vital bit of infrastructure.
We could have a Windows build machine with VS and Xamarin installed, that is connected to a Mac build machine. We'd be free to update the Windows and Mac build machines regularly, without the fear of compromising the TFS server. Is this possible? If not, why not?
Thanks in advance.
That diagram can't be right. There is no reason why you'd need VS or Xamarin installed on your TFS app tier.
I think it's showing a simplified configuration where the Windows build agent is installed alongside the app tier. That is a supported setup but is never, ever recommended by anyone, for exactly the reasons why you don't want to do it.
The diagram is simplified. You don't need to install anything on your TFS server. What you do instead is to install a Build Agent on a separate machine or virtual machine.
The installation details for the TFS 2017 / VSTS build agent v2 can be found in the official visual studio documentation.
The procedure is similar for both TFS and VSTS, where you generate an access token in TFS/VSTS, then simply enter the url for the TFS/VSTS instance when running the build agent install script, along with the access token.
There are build agents for Windows, Linux and macOS, so it is up to you how you configure how iOS builds are made.

Migrate TFS 2008 to Visual studio online? (on build and security)

we uses on-premise tfs 2008 for source safe and build engine. The build script is heavily customized with msbuild scripts. Developers uses active directory to authenticate then queue a build.
We look around to go to Visual Studio Online, question
- the big concern is the build script, we don't really want to rewrite it, is it possible to use the current MSBuild project in the VSO build process?
- for authentication, how to integrate with the on-premise AD with the VSO? how to migrate the existing security project settings to the VSO?
Ok, so the answers to all of your questions is maybe 😊.
You can continue to use your on-premises build server with VSO. If you upgrade your agents to TF Build 2010 or 2013 servers you can plug them into VSO and build in the same way.
You may be able to use the cloud build agents if you don't need custom things installed on the build agents to compile. Probably best to stick with local agents for now.
For AD you can configure an Azure Active Directory (AAD) and wire it up to VSO. There is then a connector to sync your local AD with AAD (very easy) and enable single signe-on. There are fiddly bits but mostly strait forward.
http://nakedalm.com/use-corporate-identities-existing-vso-accounts/
I enabled it for my account but without the local AD sync as I don't have one.
I have a few customer that are on VSO and sync their local AD with AAD and are very happy.

Setup continous deploy from Visual Studio/TFS to a Windows Azure VM

Is it possible to automatically deploy to a Windows Azure VM after a successful build from Visual Studio/TFS?
You question is not totally clear if you are looking for a solution for Windows Azure Virtual Machines or Windows Azure Cloud Services.
Windows Azure Virtual Machines:
With Windows Azure Virtual Machine, you own your Virtual Machine and thats why you would need to configure any deployment mechanism you decide. The OS VHD deployed for Windows Azure could be the one you upload or the one you got for gallery, so there are no basic deployment services running unless someone configure them first. For example if you will choose Windows Server based Windows Azure Virtual Machines, then you can install Web Deployment Services in Azure VM, and then configure your VS/TFS to continious deploy it or you can setup FTP based services to deploy your app. This SO discussion talks more on this regard.
Windows Azure Cloud Service:
If you are looking a solution directly from VS then you can add post build scripts using Poweshell commands. This solution will not depend on TFS at all. There are a few solutions also described which are non powershell dependent as well.
Using Visual Studio and Team foundation server components you have ability to configure the combination of MsBuild and PowerShell scripts as described here and here (same as Herve).
If you are looking for a solution directly from Windows Azure TFS (Cloud Based), this article includes everything needed.
You can find some information about automatic deployment here: http://www.windowsazure.com/en-us/develop/net/common-tasks/continuous-delivery/

Resources