I installed Azure cli on a Windows Server Agent and it works fine in cmd/PowerShell. but when I want to use Azure cli on PowerShell task in Azure Pipeline it's not working.
the error message is: 'az' is not recognized as an internal or external command.
cmd example on agent:
task code sample on Azure Pipeline:
- powershell: |
echo "*********" | az devops login --organization https://dev.azure.com/*****
displayName: 'Login on Azure CLI
I check Path environment variable and even update variables in pipeline to ensure everything fine but nothing changes.



If the AZ CLI path is not present, add it to the system variables and verify again.