You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
When running The Graph SDK module in Azure functions as a package, the authentication module fails to load, causing all other modules to also fail to load.
ERROR: Could not find file 'C:\home\site\wwwroot\.mg'
Slight addition from further testing, the reproduction steps only seem to work on a non-consumption app services plan. (used EP1). For whatever reason the error doesn't occur on consumption.
Describe the bug
When running The Graph SDK module in Azure functions as a package, the authentication module fails to load, causing all other modules to also fail to load.
I have traced the issue to this line of code:
msgraph-sdk-powershell/src/Authentication/Authentication/Common/GraphSessionInitializer.cs
Line 33 in 8b8b027
The issue is that when running
WEBSITE_RUN_AS_PACKAGE
, the user home directory is read-only, so it fails to create the directory.Workaround
You can work around this issue by creating a
.mg
directory in the root of your function project.To Reproduce
Steps to reproduce the behavior:
Microsoft.Graph.Authentication
Import-Module Microsoft.Graph.Authentication
somewhere in your functionExpected behavior
Module should load without errors
Module Version
2.2.0
Additional context
I'm wondering if #2133 is also related to this issue. Azure automation potentially obfuscating this error?
The text was updated successfully, but these errors were encountered: