az : The term 'az' 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.

Sam176
Tera Contributor

Hi,

I got the below error while executing Powershell Activity. Please help me in fixing the issue

find_real_file.png

 

 

find_real_file.png

1 ACCEPTED SOLUTION

David104
Tera Guru

Maybe a silly question, but is the powershell AZ module installed/enabled? Was it installed with the '-scope AllUsers' flag?

View solution in original post

4 REPLIES 4

David104
Tera Guru

Maybe a silly question, but is the powershell AZ module installed/enabled? Was it installed with the '-scope AllUsers' flag?

Sam176
Tera Contributor

Yes, it was installed. Do I need to install it through the mid server script as well? 

And do I need to import the module on Mid Server Script as below?

find_real_file.png

David104
Tera Guru

I would say that as long as the module is installed on the MID server itself, then you should only need to import the module in the script. I have not done it myself so I can't say for sure, but I would definitely add the import-module step

Sam176
Tera Contributor

I appreciate your response David.

I installed it on the mid server. 

Could fix the issue by removing "Connect-AzAccount"  which is not needed and "$" before "az login" from the above Script.