1

I run the following in PowerShell ISE Connect-AzAccount and it works fine , but within Jenkins when run as a Powershell command I get the following error:

The term 'Connect-AzAccount' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.

Why would this happen ?

1 Answer 1

0

Couple of things to try out:

  • You do not install AZ and Azure RM side by side , if you have it in the machine , please uninstall the Azure RM

  • Please try running the following command in order:

    Install-Module Az Import-Module Az Connect-AzAccount

Additional reference:

https://learn.microsoft.com/en-us/azure/jenkins/execute-cli-jenkins-pipeline

Using Azure CLI in Jenkins pipeline

https://wiki.jenkins.io/display/JENKINS/Azure+CLI+Plugin

Hope it helps.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.