Migrate base image on self hosted agent - azure-devops

When visiting my build agent on Azure, I get a warning that I must migrate away from Windows Server 2016 base image. I have updated the base image to the recommended version using the link provided in the warning message: How do I migrate my Windows Server 2016 container groups to Windows Server 2019 images?
The warning is still appearing in Azure Portal even though I have updated the version of the image. How can I verify that my build agent is running on Windows Server 2019 base image? This is a self-hosted agent so I'm not able to see it in DevOps -> AgentPool -> Azure Pipeline "Agent specifications"

I suppose that you could run a command line task with "systeminfo" to echo the agent information.
By the way, you could also run this command with your local CMD directly.

Related

How to get VS build agent capabilities without installing the full Visual Studio application?

I've installed the latest VS Build Tools (2022), but my on-prem build agent isn't picking up the VisualStudio-related capabilities. I've been under the impression that we no longer need to install the full application in order to get these capabilities.
An example from this blog post:
I've added all workloads to my offline layout, and I've included them in my installation.
I know this is possible, because earlier I accidentally included Python and VS 2019 Build Tools in my Node.js installation configuration. The VS-related capabilities were found by the agent then.
But I'm trying to get 2022, so I uninstalled 2019.
How can I get the 2022 VS-related capabilities to be installed and detected by my build agent, without installing the full Visual Studio product?
You need to upgrade the agent to a recent enough version. You can download the agent from the azure-pipelines-agent repository's releases page. Or manually specify the capabilities.
You may need to set a special environment flag on the agent to prevent it from automatically being downgraded to whatever version shipped with your version if Azure DevOps Server or Team Foundation Server.
And then you'll also need to install the latest version of the vsbuild/msbuild and vstest tasks
Required agent version
You will need to install the most recent agent from the azure-pipelines-agent repository for it to auto-detect Visual Studio 2022, or alternatively add the capabilities to the agent manually.
You may need to force Azure DevOps Server to not downgrade back to its preferred agent version. You can do so by setting the following environment variable at the system level on your server before launching the agent:
AZP_AGENT_DOWNGRADE_DISABLED=true
These tricks will work for most tasks in the azure-pipelines-tasks repository, as long as it doesn't depend on a UI extension or service connection type that isn't available in your version of Azure DevOps Server.
https://jessehouwing.net/adding-visual-studio-2022-to-azure-devops-server-2020/

Azure DevOps Self-hosted Agent Capabilities Ubuntu

I'm building a packer image for Azure Devops based on Ubuntu 20.04 for self-hosting. But I can't figure out how I should be adding capabilities. I've installed things like Java and Android SDK and set environment variables for their paths. I can see these when I run printenv but they aren't picked up by the agent. I've stopped & re-started the service, the only way I can get capabilities is by adding them to the .env in the folder where the devops agent is installed and stopping / restarted. How should this work ?

AzurePS System capability is not available on a newly installed vsts-agent

I have successfully installed a new VSTS agent on a new Azure VM - Windows Server 2012 R2 (64bit). When I am try to execute any pipelines containing azure powershell tasks on the new vsts agent, I get an error message :-
Error message 'No agent found in pool BuildAgent2 which satisfies the specified demands:azureps Agent.Version -gtVersion 2.119.1'
Is there any way to add AzurePS as a system capability ?
Please advise on the steps to do this - thanks.
AzurePS System capability is not available on a newly installed vsts-agent
Agree with jessehouwing.
If you want to enable AzurePS System capability, you could install the PowerShell 5.1 or higher on Windows, or PowerShell Core 6.x and later on all platforms, then install/update the Azure PowerShell module on the Azure VM:
Install the Azure PowerShell module
But the error you got should more related to the demands you set on the option tab of your build :
Check the agent version you have installed, make sure you set the correct version, or you can try to remove that demands to check if you still have this issue.
Hope this helps.
I got the same error using the AzureFileCopy#4 task in a self-hosted agent, but I solved it by installing the az module https://www.powershellgallery.com/packages/Az
Install-Module -Name Az

Linux Hosted Agents and Azure Artifacts (Symbols Publishing)

Currently when I run the Publish symbols task on the Ubuntu hosted agent I get the following error "The current operating system is not capable of running this task. That typically means the task was written for Windows only. For example, written for Windows Desktop PowerShell."
I have run this task successfully on a Windows Agent but what I have seen it doesn't work on Linux. The only thing that I have seen that could work on Linux is SourceLink but that doesn't work with Azure DevOps Artifacts yet.
Looking around I'm not able to see any way to publish symbols to Azure DevOps artifacts on a Linux agent? Has anybody else encountered this issue and were you able to get around it?

Tean Services Build Agent and System.Io.Compression

We have a setup with MS Team Services where we have some local build agents. Recently we had some issues with errors about a not found system.io.compression. At the same time we could use hosted agents, but want to have the local running again. On one machine we managed to install a new agent that worked, but on another we get an error about system.io.compression when we try to install the agent. I'm not sure why this is suddenly an issue, maybe som gac mess up or other thing we need to clean up. the machines running the agents all have the latest Visual Studio 2017 installed