VSTS Agent Auto Update fails to update - azure-devops

Reading the VSTS documentation about Build and Release Agents, that says:
Each agent automatically updates itself when it runs a task that requires a newer version of the agent. But if you want to manually update some agents, right-click the pool, and then click Update all agents.
That doesn't work for me.
I tried to "right-click the pool, and then click Update all agents", the status change to "Downloading version ....". But I can't see any change with the agent.
Every time, I have to uninstall the agent, download the new version and reinstall it again. I've checked directory permissions and everything looks fine. The agents are installed on a Windows Server 2012 x64.
Any idea?

It takes some minutes (per to the environment, such as network) to update the agent and will be restarted automatically, then you can check the Agent.Version value in Capabilities.

Are your agents in a machine behind a proxy?
In this case, you need to configure the proxy:
Add a file named .proxy in the root folder where the agent is installed
Write as content the proxy address to be used, for example http://192.168.0.1:1234
If your proxy needs authentication, you must set these environment variables:
set VSTS_HTTP_PROXY_USERNAME=user
set VSTS_HTTP_PROXY_PASSWORD=password
Restart the agent service to apply the change
The agent should now be able to connect to internet and download to apply the update.

Related

Error while running yaml pipeline in azure devops

I am running a java code with yaml pipeline with self hosted agent,But it shows below error
##[error]No agent found in pool Winagentpool which satisfies the specified demands: maven, Agent.Version -gtVersion 2.163.1
Can someone help me out on this,Thanks in advance.
Demands are a way of saying "I need the agent to have this capabilities in order to run". Capabilities are basically key-value tags assigned to agents. When an agent starts, it analyses its environment, and tries to detect things like OS version, agent version, availability of SDKs (like java), etc. In this case, your pipeline wants an agent with version >= 2.163.1 and with Maven available.
You can view and configure agent capabilities in Organization settings->Agent pools.
The error suggests that your agent version is to old and/or it didn't detect maven installation. Verify agent version and check if M2_HOME env variable is defined on the agent (system-wide).
As a way of last resort, you can try and add maven capability manually.

Swap Azure Agent to Service

Is there a clean way to swap an azure agent to run as a service. When I installed it I decided to install to have run manually. As time has gone on the need to convert to a service is becoming bigger and bigger. Is there an easy way to convert it over to a service without having to reinstall an agent?
Could always just tell windows to run it as a service which I imagine would work, but any other thoughts.
Thanks.
We could configure the self-hosted to run interactively or run as a service, if you have configured it run interactively, we can't change the way it works, if you want to change it, we need to remove and re-configure an agent
To remove the agent:
.\config remove
After you've removed the agent, you can configure it again.

Agents in Azure DevOPS 2019 [duplicate]

i'm facing a problem with VSTS agent state is offline i installed the agent through cmd under the right pool and downloaded after that but it still offline any help please ?
If the build agent is running as interactive mode, you need to start agent by running run.cmd file:
Open Command line as administrator
Run run.cmd file (under agent folder)
If the build agent is running as service, you can check whether the related service is running in Services.

What is actual TFS 2018 Build server configuration ? If i complete agent installation will that be considered as build server?

I have installed TFS 2018 and I'm trying to setup dedicated build server for this.
I have three windows servers one for TFS-WindowsBox1(TFS 2018 Installation completed), one for Build server-WindowsBox2(Build server setup steps and architecture needed), DB-WindowsBox3(DB Installation completed).
I'm looking for build server setup on WindowsBox2 and I'm looking best practices or steps to follow.
In administration section, I'm seeing agent download option in agent pools tab.
If i download and install agent on windowsbox2 server , will that be considered as Build server.
And what are the differences between agents and build server setup ?
TFS has no concept of a "build server". If an agent is configured on a box and the agent is running, then that box can run builds (and releases, since the release agent is the same piece of software). That's all there is to it. Build agents are assigned to agent pools, which dictate the set of available agents.
In previous iterations of the build system (XAML build, TFS 2010 - TFS 2013, although it's configurable up to TFS 2018), you had to register build controller and assign build agents to the build controller. XAML build is deprecated and should not be used except in the cases of pre-existing legacy builds, so if you're not already using XAML build, you can safely ignore this paragraph.
You can refer to this article (Deploy an agent on Windows) to setup TFS build/release agent, after that this is your "build server".
There are interactive and service mode and by default it is running in interactive mode, for this mode, you need to call run.cmd (in the same folder of config.cmd) to start agent, then the agent state will be online.
With service mode, you can check whether the corresponding service is running or not in Services.

Visual Studio Team Services Build Queue Not Appearing in List

I'm setting up a build definition in Visual Studio Team Services using a Build Agent installed on my local machine for testing.
I'm following these instructions for creating a build agent, setting up a build definition, and queuing a build. I've created the agent on my local computer and it appears in the agent pool in VSTS. The agent is enabled and ready to go. I've also created a build definition that invokes my build script. Everything up to this point appears to work fine.
At this point I'm ready to queue a build and run it. The dialog for this looks like:
The dropdown labeled "Queue" only shows the Hosted agent pool. There should be a second pool called Default but it is not appearing. I can get it to "appear" by right clicking and inspecting the HTML and then using dev tools to change the value for the Hosted option. Hosted's ID is 2, I changed it to 1 since I assumed this to be the ID for Default. Once I do this I can click "OK" and the build runs as expected -- everything is checked out on my local machine by the build agent. Presumably my assumption about the ID value is correct.
So...everything it working correctly once I muck around with the plumbing a bit. But this is definitely not the way things should be working. Why is the Default queue not showing up in the dropdown? Do I need to flip a switch somewhere to make it work? Does my account not have enough access?
Some other details:
My account is a "Pool Administrator"
The build agent is not installed as a Windows service. I start it manually from a command prompt. I've not been able to install it as a service.
The machine that has the build agent installed on it is running Windows 10 x64 Pro. It was upgraded from Windows 8 x64 Pro.
I cannot use a hosted agent as I'm building a Unity project and Unity is not supported by for hosted agents.
I know I can use Unity Cloud Build but I do not want to.
UPDATE
I've removed my previous Build Agent and installed a new one, as a service, on a Windows Azure VM running Windows 10 Enterprise x64. With this change the "Hosted" and "Default" queues are appearing as expected.
Your account needs to also have access to the agent queue. Agent pools and agent queues are different entities, and being a "pool administration" does not necessarily mean you are a "queue administrator".
In my case it helped to execute the agent configuration in a console with elevated/administrator rights. If the agent configuration is done in a console with normal rights, the agent can still be configured properly, but its queue won't appear for selection when you will be queuing a new build.