Azure Function App Managed Identities
Having problems using the preview modules in Azure Function Apps.
Able to Authenticate with the new connect-mggraph -identity but unable to import other modules that I need. Microsoft.Graph.User Microsoft.Graph.Groups Microsoft.Graph.Applications If I just try to call the command directly which just says it can't load the module.
ERROR: Could not load file or assembly 'Microsoft.Graph.Groups.private, Culture=neutral, PublicKeyToken=null'. The system cannot find the file specified.
Getting the following error message:
Exception : Type : System.IO.FileNotFoundException Message : Could not load file or assembly 'Microsoft.Graph.Groups.private, Culture=neutral, PublicKeyToken=null'. The system cannot find the file specified. FileName : Microsoft.Graph.Groups.private, Culture=neutral, PublicKeyToken=null TargetSite : Name : Bind_LoadAssemblies DeclaringType : initialsessionstate MemberType : Method Module : System.Management.Automation.dll Source : System.Management.Automation HResult : -2147024894 StackTrace : at System.Management.Automation.Runspaces.InitialSessionState.Bind_LoadAssemblies(ExecutionContext context) at System.Management.Automation.Runspaces.InitialSessionState.Bind(ExecutionContext context, Boolean updateOnly, PSModuleInfo module, Boolean noClobber, Boolean local, Boolean setLocation) at Microsoft.PowerShell.Commands.ModuleCmdletBase.LoadModuleManifest(String moduleManifestPath, ExternalScriptInfo manifestScriptInfo, Hashtable data, Hashtable localizedData, ManifestProcessingFlags manifestProcessingFlags, Version minimumVersion, Version maximumVersion, Version requiredVersion, Nullable`1 requiredModuleGuid, ImportModuleOptions& options, Boolean& containedErrors) CategoryInfo : InvalidOperation: (:) [Import-Module], FileNotFoundException FullyQualifiedErrorId : FormatXmlUpdateException,Microsoft.PowerShell.Commands.ImportModuleCommand InvocationInfo : MyCommand : Import-Module ScriptLineNumber : 59 OffsetInLine : 5 HistoryId : 1 ScriptName : C:\home\site\wwwroot\AddADGroupsToSharePoint\run.ps1 Line : Import-Module Microsoft.Graph.Groups
PositionMessage : At C:\home\site\wwwroot\AddADGroupsToSharePoint\run.ps1:59 char:5
+ Import-Module Microsoft.Graph.Groups
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
PSScriptRoot : C:\home\site\wwwroot\AddADGroupsToSharePoint
PSCommandPath : C:\home\site\wwwroot\AddADGroupsToSharePoint\run.ps1
InvocationName : Import-Module
CommandOrigin : Internal
ScriptStackTrace : at
Thanks for following up on this.
Can you share the output of the following to help us investigate the issue:
- Loaded modules before and after the error:
# Provide output of Get-Module Microsoft.Graph.Users, Microsoft.Graph.Groups, Microsoft.Graph.Applications, Microsoft.Graph.Authentication | select Name, Version.
- Error record of the failed command -
Get-Error -Newest 1:
# Provide output of Get-Error -Newest 1 here.
- Your version table:
# Provide output of $PSVersionTable here.
This issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 4 days. It will be closed if no further activity occurs within 3 days of this comment.