question

ThavaselvanP-4983 avatar image
0 Votes"
ThavaselvanP-4983 asked azure-cxp-api edited

Not able to execute AZ comments using System.Management.Automation lib in IIS

i wanted to execute the az login using System.Management.Automation. its working in my local. when i tried to deploy the same in web server, the system is not recognizing AZ comments,

Note: I've already installed AZ cmdlets


  public class ValuesController : ApiController
         {
             // GET api/values
             public IList<PSObject> Get()
             {
                   
        
                 using (PowerShell ps = PowerShell.Create())
                 {
                     ps.AddScript("Import-Module Azure; az login");
        
                     var token = ps.Invoke();
        
                     return token;
                 }
        
             }
        
         }



not-supported-azure
· 2
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

@ThavaselvanP-4983
Thank you for your question!

Are you able to provide the error message that you're receiving along with any documentation that you're following to set this up?


If you have any other questions, please let me know.
Thank you for your time and patience throughout this issue.

0 Votes 0 ·

@ThavaselvanP-4983
I just wanted to check in and see if you had any other questions or if you were able to resolve this issue?

0 Votes 0 ·

0 Answers