Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in Azure by (13.1k points)

I have created a docker container using Dockerfile, but when use it for Azure DevOps container job. It throws an error:

# [error]Azure CLI 2.x is not installed on this machine.

Can anyone help me how do I rectify this error?

1 Answer

0 votes
by (26.7k points)

You can try the below command from your pipeline. It will work fine:

- task: AzureCLI@1

  displayName: 'Azure CLI '

  inputs:

    azureSubscription: xxxxx

    scriptLocation: inlineScript

    inlineScript: 'az acr list'

Now, that will install Azure CLI.

I hope this will help.

Want to become an Azure DevOps expert? join azure devops certification now!!

Browse Categories

...