简体   繁体   中英

Connect-Msolservice error after publishing the code to Azure Web App

I was developing an Asp.Net web application that will execute particular PowerShell Commands for Office 365. The code contains two parts of the commands (Exchange Online and MSOnline Command). The code is working fine locally on my PC. But When I published the code into Azure Web App the Exchange Online Commands are working as I expected it, but MSOnline commands are giving the below error:

The term 'Connect-MsolService' 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.

I am sure that this error has raised because it did not find the matched MSOnline dlls files to import the module. I have added the dll's using Kudo but also the same. anyone have any idea how to solve this one.

Thank you always

Doing some reading here and here , it looks like you aren't allowed to install the prerequisites needed unless you upgrade (the answer in that second link describes that).

I have had to do this too: call PowerShell from C# for Office 365 administration, so I feel your pain :) although we host on a normal Windows server.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM