Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

azure-devops

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.

like image 410
dipika-bg Avatar asked Oct 16 '19 14:10

dipika-bg


2 Answers

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 :

enter image description here

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.

like image 152
Leo Liu-MSFT Avatar answered Oct 25 '22 06:10

Leo Liu-MSFT


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

like image 1
Pedro Dominguez Bruno Avatar answered Oct 25 '22 04:10

Pedro Dominguez Bruno