TFS 2013: An error occurred while initializing a build for build definition (The remote name could not be resolved)

build-serverteam-foundation-server

I'm trying to start a build from my TFS to my Build Controller. Both are not inside a domain or active directory. The Build Server is a virtual machine hosted in Hyper-V on the dedicated TFS machine.

Now everytime I try to run a build, it gives the following error:

TF215097: An error occurred while initializing a build for build definition \Website\Development_Continous: 
Exception Message: One or more errors occurred. (type AggregateException)
Exception Stack Trace:    at System.Threading.Tasks.Task`1.GetResultCore(Boolean waitCompletionNotification)
   at Microsoft.TeamFoundation.Build.Client.FileContainerHelper.GetFile(TfsTeamProjectCollection projectCollection, String itemPath, Stream outputStream)
   at Microsoft.TeamFoundation.Build.Client.FileContainerHelper.GetFileAsString(TfsTeamProjectCollection projectCollection, String itemPath)
   at Microsoft.TeamFoundation.Build.Client.ProcessTemplate.Download(String sourceGetVersion)
   at Microsoft.TeamFoundation.Build.Hosting.BuildControllerWorkflowManager.PrepareRequestForBuild(WorkflowManagerActivity activity, IBuildDetail build, WorkflowRequest request, IDictionary`2 dataContext)
   at Microsoft.TeamFoundation.Build.Hosting.BuildWorkflowManager.TryStartWorkflow(WorkflowRequest request, WorkflowManagerActivity activity, BuildWorkflowInstance& workflowInstance, Exception& error, Boolean& syncLockTaken)

Inner Exception Details:

Exception Message: An error occurred while sending the request. (type HttpRequestException)
Exception Stack Trace:    at Microsoft.VisualStudio.Services.WebApi.VssHttpRetryMessageHandler.<SendAsync>d__1.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Runtime.CompilerServices.ConfiguredTaskAwaitable`1.ConfiguredTaskAwaiter.GetResult()
   at Microsoft.VisualStudio.Services.WebApi.HttpClientExtensions.<DownloadFileFromTfsAsync>d__2.MoveNext()

Inner Exception Details:

Exception Message: The remote name could not be resolved: 'tfs001' (type WebException)Exception Stack Trace:    at System.Net.HttpWebRequest.EndGetResponse(IAsyncResult asyncResult)
   at System.Net.Http.HttpClientHandler.GetResponseCallback(IAsyncResult ar)

That's reasonable, because 'tfs001' does not exist in the local network (only an external DNS, tfs.domain.com, exists). How can I get the Build Machine to use a Domain Name instead of the Hostname from the local network?

Best Answer

You need to configure TFS for a friendly URL. If you then reconnect the build agent to your tfs server it should then use this config.

http://www.edsquared.com/2011/01/03/Using+Friendly+DNS+Names+In+Your+TFS+Environment.aspx