0
votes

I have configured one Azure VM as a private agent in Visual Studio Team Services.

  • Created one Azure VM
  • Installed required software's to compile the .net solution
  • Configured Build Agent on VM by following these steps - (Deploy an agent on Windows)
  • After configuring the agent, the status of agent is Online

I have created one build definition to only getsources task and Nuget restore task. Here the agent used is now the private agent.

When the build is triggered,Get Sources task execution was completed.Below are the logs showed in GetSources task:

##[section]Starting: Get Sources
Syncing repository: VHS (TfsGit)
Prepending Path environment variable with directory containing 'git.exe'.
##[command]git version
git version 2.14.3.windows.1
##[command]git lfs version
git-lfs/2.3.4 (GitHub; windows amd64; go 1.8.3; git d2f6752f)
##[command]git init "D:\a\1\s"

But when I checked in Azure VM, the directory D:\a\1\s was not created.

  • Where will the code get copied?
  • How can I change the path to which the source should get copied?
  • In Azure VM I only have the C drive, How can I use this drive to get the source code copied?
  • Do I need to configure Team Foundation Build Service on that VM for Build Controller?
3
You said that "In Azure VM I only have the C drive", but based on the log, the path is D:\a\1\s, do you choose the correct agent queue? How many agents in that pool? What's the working directory when you configure build agent? - starian chen-MSFT
@starian - I have only one private agent and same is been consumed in build definition. The working directory was C drive - Amruta
Can you share the detail log on the OneDrive? (Set system.debug variable to true, then queue build and share this log) - starian chen-MSFT
@starian - thank you for your response. I am now able to get sources copied to my private agent. I just again performed the steps of configuring build agent. - Amruta
@starian - One question- whenever the build is triggered, the source code is copied to a particular folder. Currently my source is copied @C:\agent\test\1\ folder. But when new build is triggered, there is no new folder created in test directory - Amruta

3 Answers

0
votes

You need to update your build definition to use the agent queue to which you registered your build agent.

0
votes

You cannot change the place where your sources are downloaded without reinstalling your agent, but I don't believe that is your problem. The sources get downloaded to drive:\agent_work_dir\build_id\s.

You don't need to install Team Foundation Build Service on the machine, just the build agent, as you did.

In your build definition, you have to select the agent queue where your private agent is associated.

enter image description here

Please keep in mind that if you have more than one build agent associated with the pool, the build system will use the first one that is available.

To use an specific agent, you have to do this clicking on "Run on Agent" phase and add a specific capability on the demands area, like the agent name.

0
votes

Issue resolved by configuring the agent once again and restarting the service/ agent from windows services. After performing this step the source code was getting copied to C drive.