Self-hosted agent does not update automatically - azure-devops-self-hosted-agent

I have configured self-hosted agents behind a pool that has enabled "Allow agents in this pool to automatically update" option. When there are a new version, I can see that the update proccess try to upgrade agents, but nothing happens. I can´t see any error. What I can see is that new agent version is downloading, then the agent turn off-line, then on-line but the agent version is the same old version.
I can download manualy the new agent version from the build server, so I dont know what's wrong.
Please, does anyone knows what i have to do in order to get agents automatically updated.

No matter what, you should update the agent manually every time to enable the new feature of it. And there is no such option for azure devops to update the private agent automatically when you make changes.
You could configure your private agent to run as a windows service, but that is for restarting agent. I think that is not what you want. When you make changes for agent(not restart), you have to update the agent manually.
As a suggestion, you should suggest a feature to the Team and then they will give you any feedback about the new idea.

In order to update Self-hosted agent automatically It's required to configure URLs and IPs in Firewall/Proxy settings. Please go to:
https://learn.microsoft.com/en-us/azure/devops/organizations/security/allow-list-ip-url?view=azure-devops&tabs=IP-V4#ip-addresses-and-range-restrictions

Related

change agent.name | Azure devops agents

is it possible to change the agent.name? without to delete the agent and reinstall?
linux system
picture
I try to vim the config.sh and I didn't find that variable
I am afraid that there is no such method can directly change the agent name without re-installing the self-hosted agent.
The agent name is a primary key in the backend. We need to re-install the self-hosted agent, then you can change the self-hosted agent name.
Refer to the doc about the steps to re-install the self-hosted agent.
I can fully understand your requirement. You can create a suggestion ticket in Developer Community to report your requirement.

Azure devops build stuck in queue when using sonarqube

I’m using SonarQube 8.8 on Azure DevOps.
It’s work just fine, I have analyzed severals applications. However i have a problem on some applications:
When I run the pipeline it get's stuck in queue indefinitely "The agent request is not running because all potential agents are running other requests. Current position in queue:"
But as soon as I remove the sonarqube tasks, the build works just fine. There is no error message so I have no clue about where the problem may come from.
Can you please help
In your current situation, we recommend you can check your agent pool and make sure your all agent is available. And please check your parallel jobs. Also, we recommend you can try to create more self-agent in your local machine and try to run this pipeline.
And you can refer Sourav's answer in the comment.
More details about this issue you can refer this doc: You don't have enough concurrency

VSTS Hosted agents state

I am wondering how VSTS hosted agents provisioning works in terms of state. Does a hosted agent get reassigned from one job to another without being 'snapshotted' back to a 'clean' state? Or does it carry around the remnants from previous builds?
Thanks
There won't has any data 'leakage' between different subscriptions to use Hosted agent, even you build the same build definition for twice, you can not get any data from first build to second build.
That's why Clean option is not relevant when you use Hosted agent, and you can find Clean the local repo on the agent section:
Note
Cleaning is not relevant if you are using a hosted agent because you
get a new agent every time in that case.
Hosted agents are single-use only. They are not reused between builds.

VSTS - how to select local agent for Release definition

We are unable to run any release becouse of the following message:
Your account has no free minutes remaining. Add a hosted pipeline to run more builds or releases.
I guess this happend becouse one of our build was using the hosted version and not the private pipeline.
The problem now is that we cannot run any builds. The builds are running fine (on local agents) but we're unable to run any releases.
How can we modify the release definition to use a local agent?
Thanks for any help
You can choose the agent queue to use for a release within the Phase view within an environment.
A release has environments. An environment can have multiple phases. Each phase can run on a different agent queue.
This sounds like a licensing issue to me. VSTS Release pipelines are a paid product. You get 1 hosted and/or private pipeline free each month, but after that you pay for each one. Hosted pipelines are also limited to the number of minutes you can execute them (You get 240 free minutes).
Check out this page for additional details and make sure you are licensed up.
Also, if you have Visual Studio Enterprise licenses, these will grant you extra pipelines per user.

How to deploy artifacts of TeamCity to Amazon EC2 Server

We decided to use AMAZON AWS cloud services to host our main application and other tools.
Basically, we have a architecture like that
TESTSERVER: The EC2 instance which our main application is
deployed to. Testers have access to
the application.
SVNSERVER: The EC2 instance hosting our Subversion and
repository.
CISERVER: The EC2 instance that JetBrains TeamCity is installed and
configured.
Right now, I need CISERVER to checkout codes from SVNSERVER, build, if build is successful, unit test it, and after all tests pass, the artifacts of successful build should be deployed to TESTSERVER.
I have completed configuring CISERVER to pull the code, build, test and produce artifacts. But I couldn't manage how to deploy artifacts to TESTSERVER.
Do you have any suggestion or procedure to accomplish this?
Thanks for help.
P.S: I have read this Question and am not satisfied.
Update: There is a deployer plugin for TeamCity which allows to publish artifacts in a number of ways.
Old answer:
Here is a workaround for the issue that TeamCity doesn't have built-in artifacts publishing via FTP:
http://youtrack.jetbrains.net/issue/TW-1558#comment=27-1967
You can
create a configuration which produces build artifacts
create a configuration, which publishes artifacts via FTP
set an artifact dependency in TeamCity from configuration 2 to configuration 1
Use either manual or automatic triggering to run configuration 2 with artifacts produced by configuration 1. This way, your artifacts will be downloaded from build 1 to configuration 2 and published to you FTP host.
Another way is to create an additional build step in TeamCity for configuration 1, which publishes your files via FTP.
Hope this helps,
KIR
What we do for deployment is that the QA people log on to the system and run a script that deploys by pulling from the team city repository whenever they want. They can see in team city (and get an e-mail) if a new build happened, but regardless they just deploy when they want. In terms of how to construct such a script, the team city component involves retrieving the artifact. That is why my answer references getting the artifacts by URL - that is something any reasonable script can do using wget (which has a Windows port as well) or similar tools.
If you want an automated deployment, you can schedule a cron job (or Windows scheduler) to run the script at regular intervals. If nothing changed, it doesn't matter much. I question the wisdom of this given that it may mess up someone testing by restarting the system involved.
The solution of having team city push the changes as they happen is not something that team city does out of the box (as far as I know), but you could roll your own, for example by having something triggered via one of team city's notification methods, such as e-mail. I just question the utility of that. Do you want your system changing at random intervals just because someone happened to check something in? I would think it preferable to actually request the new version.