We are running TFS and Release Management on premises, and i want to deploy my applications to a remote datacenter. Access is over the internet, so there is no windows shares available. I am using the vNext templates, and afaik RM seems to only support unc paths over windows shares.
How can i use Release Management to deploy software to this datacenter?
Im working on this solution: Use WebDav on a IIS located inside the datacenter. RM server and Target can use the WebDav client built into windows and access it by an unc path.
I haven't gotten this to work yet, as RM won't use the correct credentials to logon to the webdav server.
Updated with my solution This is only a proof of concept, and is not production tested.
- Setup a WebDav site accessible from both RM server and Target server
- Install the feature "Desktop experience" on both servers
Make the following DLL
using System; using System.ComponentModel.Composition; using System.Diagnostics; using System.IO; using Microsoft.TeamFoundation.Release.Common.Helpers; using Microsoft.TeamFoundation.Release.Composition.Definitions; using Microsoft.TeamFoundation.Release.Composition.Services; namespace DoTheNetUse { [PartCreationPolicy(CreationPolicy.Shared)] [Export(typeof(IThreadSafeService))] public class DoTheNetUse : BaseThreadSafeService { public DoTheNetUse() : base("DoTheNetUse") {} protected override void DoAction() { Logger.WriteInformation("DoAction: [DoTheNetUse]"); try { Logger.WriteInformation("# DoTheNetUse.Start #"); Logger.WriteInformation("{0}, {1}", Environment.UserDomainName, Environment.UserName); { Logger.WriteInformation("Net use std"); var si = new ProcessStartInfo("cmd.exe", @"/c ""net use \\sharedwebdavserver.somewhere\DavWWWRoot\ /user:webdavuser webdavuserpassword"""); si.UseShellExecute = false; si.RedirectStandardOutput = true; si.RedirectStandardError = true; var p = Process.Start(si); p.WaitForExit(); Logger.WriteInformation("Net use output std:" + p.StandardOutput.ReadToEnd()); Logger.WriteInformation("Net use output err:" + p.StandardError.ReadToEnd()); } //########################################################## Logger.WriteInformation("# Done #"); } catch (Exception e) { Logger.WriteError(e); } } } }
Name it "ReleaseManagementMonitor2.dll"
- Place it in the a subfolder to The service "ReleaseManagementMonitor"
- Configure the shared path as the solution below states.
DO NOT OVERWITE THE EXISTING "ReleaseManagementMonitor2.dll"
The reason that this works is MEF. The ReleaseManagementMonitor service tries to load the dll "ReleaseManagementMonitor2.dll" from all subfolders. This dll implements a service interface that RM recognises. It the runs "net use" to apply the credentials to the session that the service runs under, and thereby grants access to the otherwise inaccessible webdav server.
This solution is certified "Works on my machine"
RM does work only with UNC, you are right on that.
You can leverage that to make your scenario work -
In Theory
How this works
1. Have a dedicated machine on the RM server domain (say D1) that will be used as a boundary machine.
2. Define this machine as a boundary machine in RM by specifying a shared path that will be used by your data centre. Go to settings tab in your WPF console, create a new variable - { Key = RMSharedUNCPath, Value = \\BoundaryMachine\DropsLocation }. RM now understands you want to use this machine as your boundary machine.
3. Make sure you take care of these permissions
4. Credentials can be passed down fron the WPF console, you will have to define the following two config variables in the settings tab again.
PS - Variable names are case sensitive.
Also, to let RM know that you want to use the SharedUNC mechanism, check the corresponding checkbox for the RM server and connect to it via IP and not DNS name as these must be in different domains, i.e.