Build definition to deploy to remote private server - visual-studio

I have recently learned about Visual Studio Team Services continuous integration and I would like to add a build-step in my build definition to deploy the website files to a remote development server. Similar to what the Azure Web App Deployment does but to my own hosting server. I have figured a way to do this using the Windows Machine File Copy or using a custom PowerShell script, but the problem is, I have to open up my server's ports for SMB to get this working.
Is there a list of IP addresses I could white-list that Visual Studio Team Services uses? From 4 build tests, I managed to get four IP addresses:
- 13.80.13.96
- 40.114.244.33
- 40.114.240.144
- 104.47.152.33
This does not look very promising.
I may be complicating things, so is there a better way of doing this securely?

SMB shouldn't factor into it. The Windows Machine File Copy task uses WinRM. For security, make sure you use HTTPS and valid certificates in place.
There is no list of valid IP address ranges for the hosted build agents that I'm aware of.

You can also add a "Command Line" task to use MSDeploy to publish the website if your private server run with IIS. (Set the "Tool" area in "Command Line" task to "C:\Program Files (x86)\IIS\Microsoft Web Deploy V3\msdeploy.exe" if you are using Hosted Build Agent.)
Some reference links:
Using MSDeploy to publish your site
(MSDeploy) Deploying Contents of a Folder to a Remote IIS Server

Related

how to set up visual studio for a remote project

Can Visual studio 2019 be used as a local IDE for a solution running on a remote server? specifically i want to create a node.js application on a remote server hosted / provided by my ISP using Vstudio that's running on my local windows machine. I'd like the builds to run on the remote server. Is this possible?
To date, I have been connecting via ssh and just using VIM to create my apps. But I see that VStudio is free and has a lot of support for different types of apps so wanted to give a try.
I launched VStudio and created a new node.js application. Gave it a name (it was pointing to a local folder)
But then when I tried to do was go under Tools -> options ->Cross platform-> connection manager.
I successfully added a connection to my remote server. I know the connection worked because it detected that the remote server is running Ubuntu.
I must be still missing a step because when I try to build, instead of running the build against the remote server, it tries to build locally.
Maybe I can't do this. Maybe I need a local dev environment... build local and then copy the js files over to the target machine.
But jut thought I'd check
Thanks.

VS2013 hosting on existing azure virtual machine

When you start a New Project in VS 2013, you can choose to host the project on an Azure Virtual Machine.
The problem is that it seems you can ONLY CREATE a NEW ONE and not host it on an existing virtual machine you might already have.
Or at least, I cannot find the way to do so and cannot find anything on the net that shows me how.
QUESTION:
How can I use my existing Azure Virtual Machine to host an MVC application developed from my desktop??
If I understand what you're after, you can simply install and configure IIS, create a virtual and point it to the file system path where you have your production code (you can simply upload it to the server). You would then simply open up the appropriate ports in the Azure interface to allow external access if desired. You're basically just setting up an IIS site that can host your application then uploading the app to the server using something like FTP or web deployment.
-matt

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/

How do I run (debug) WCF REST Service application on local IIS7 server

As the question says, I have a problem running the web app on local IIS.
Here is my situation:
WIndows over Oracle VM VirtualBox running on Linux Ubuntu.
Bridged Adapter so that Windows box gets local IP from my router.
Visual Studio 2010 + sp
WCF REST Service application plugin for project template
The application runs when using visual studio development server (on localhost).
Target framework is v4.0
What I need is that the application runs on IP instead on localhost (so I can consume it on remote computer in LAN), so I configured IIS7.
Here is IIS configuration:
I created a website with target framework v.4.0
I binded the site to my local IP on port 80
Path to the site is /inetpub/wwwroot iisstart.htm as default document
IIS runs ok. If I open "http://my_local_ip" I get the welcome logo.
The problem is in visual studio.
When I go to project properties "Web" section and select local IIS over vsd server is where I get lost. If I set "Project URL" to "http://my_local_ip/some_name" visual studio complains that it cannot find IIS server and so it was unable to create the virtual directory. I tried manually adding virtual directory in IIS manager, but no effect. If I use "http://localhost/some_name" as the "Project URL" the virtual directory gets created, but it makes no sense does it?
Could some one please enlighten me?
If I use "http://localhost/some_name" as the "Project URL" the virtual directory gets created, but it makes no sense does it?
I think you are mixing two different things here. When you ask VS to use localhost as the IIS Server for your project, it will connect to the local IIS to perform configuration tasks. If you ask VS to use "my_local_ip" you are telling VS that you IIS Server is remote, and therefore VS will use remote administration to configure IIS (VS can't know that my_local_ip is the local computer).
But remote IIS admin isn't enabled on a default WinServer box. Furthermore, it would require some additionnal network config. You should therefore tell vs to use the local server.
In fact, IIS site bindings and VS deployment parameters are too completely different things. So, deploy your site on http://localhost/your_site.
However, I don't really like the prospect of using VS debugging deploy to deploy a real app. The directory will contain all your project files... You should:
create your site on IIS manager and setup a virtual directory.
Either
ask VS to publish the site to a directory (your virtual directory)
ask VS to publish a WebDeploy package, then ask IIS manager to import the package.

I want to keep my source protected on my development machine, how would I deploy ASP.NET MVC to the server?

I'm not exactly sure what to do, normally I do a commit to SVN and Cruise Control does all this stuff on the server to pull from the repo and deploy everything.
However I am just playing around for fun with my personal VPS and want to know how I can from Visual Studio 2010 (web express) on my local machine just make some kind of installer or DLL or whatever and how to deploy it to my VPS of Windows Server 2008.
Do I upload via FTP and run something or place some files in a certain location and configure through IIS? Or is there some way Visual Studio can just interface with my server and impregnate it with my beautiful code?
From the description given, I'd recommend 2 options:
check whether your server installation currently supports one-click publishing. It's likely an IIS configuration task(s) and/or ensuring your server supports MSDeploy/WebDeploy. See "One-Click Publishing - What's New". Publish Use Visual Studio 2010's Publish command to perform a Web Deploy of your solution.
setup an FTP server on your server. Use Visual Studio 2010's Publish command with the FTP option to push your built solution.
Would this MSDN article help?
The thing is there's capabilities in Visual studio that can publish a web application on a web server.
But you can always do an xcopy deployment as well. And since you've obviously never deployed a web application yet maybe it would be good to learn something and actually deploy it manually.

Resources