'Azure CLI not found in Jenkins

I have install azure cli plugins in jenkins after that i setup Azure Service Principal and got Successfully verified the Microsoft Azure Service Principal after that i create a new job and added az version to check az is installed or not in it and got failed error below is the screenshot of that error

Note:- My Jenkins is having v2.332.1 and installed in AKS Cluster as a Helm chat my jenkins is running

enter image description here

Here is the screenshot of plugin installed enter image description here

Here is the my job new create in freestylejob enter image description here

Please help out with this issue



Solution 1:[1]

You need to install azure cli in the Jenkins Host as well.

from https://plugins.jenkins.io/azure-cli/ - Prerequisites

To use this plugin, first you need to have an Azure Service Principal in your Jenkins instance.

1.Create an Azure Service Principal through Azure CLI or Azure portal.

2.Open Jenkins dashboard, go to Credentials, add a new Microsoft Azure Service Principal with the credential information you just created.

3.Install Azure CLI in the Jenkins Host

from your description, I can see you have 1,2 steps completed and possibly 3 is missing.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Vineesh Vijayan