Hi all,
We have had a Powershell Function App running hundreds of time a day for the past three years without any issues. Suddenly in the past week, it's failing almost 95% of the time.
The function app now fails when loading the Powershell Module (MSOnline) using the Import-Module cmdlet, like this:
$currentDir = (Get-Location)
Import-Module "$currentDir\bin\MSOnline\1.1.183.66\MSOnline.psd1" -UseWindowsPowerShell
This results in the following error:
[Error] ERROR: Failed to generate proxies for remote module 'MSOnline'. The -OutputModule parameter does not resolve to a path, and a user module path cannot be found for the provided name.Exception :Type : System.InvalidOperationExceptionMessage : Failed to generate proxies for remote module 'MSOnline'. The -OutputModule parameter does not resolve to a path, and a user module path cannot be found for the provided name
Searching the web and these forums does not give me any more insight to what this might mean. The -OutputModule is not a flag for the Import-Module command.
(The complete stacktrace is available in this gist: https://gist.github.com/stevenrombauts/ac74463a78c278935a457ceb867e9b5f )
What 's even crazier is that it sometimes does work. I can hit the same function app once and get a good result, and the next 10 requests will fail. Once it fails, it seems to keep on failing.
We included the MSOnline files in our function app files directly to improve performance and load it directly from its path. This has always worked fine. For testing today I tried loading it again through requirements.psd1 file and let Azure handle it, but it won't even successfully install the module anymore (this worked about a year ago).
We're running on Function App Runtime ~3, with PowerShell Core 7.0 on 64 bit.
Does anyone have an idea as to what might be going on here?
Many thanks for your help.
Best regards,
Steven