PowerSehll Azure function to connect to sharepoint site #4938
Unanswered
SharePointDevbirchgold
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I have a power-shell azure function which have its managed identity enabled and i applied the needed perversion to the azure function to access SharePoint sites. now i have a site named "HR" and a list named "emails", so how i can get all the items inside the emails list? and then delete them?
I tried the following:-
1- Inside the requirements file, i added those references:-
2- Then i added this code to connect to SharePoint online:-
But I got this error :-
2025-05-24T16:25:05Z [Warning] The Function app may be missing a module containing the 'Connect-PnPOnline' command definition. If this command belongs to a module available on the PowerShell Gallery, add a reference to this module to requirements.psd1. Make sure this module is compatible with PowerShell 7. For more details, see https://aka.ms/functions-powershell-managed-dependency. If the module is installed but you are still getting this error, try to import the module explicitly by invoking Import-Module just before the command that produces the error: this will not fix the issue but will expose the root cause.
2025-05-24T16:25:05Z [Error] ERROR: The term 'Connect-PnPOnline' is not recognized as a name of a cmdlet, function, script file, or executable program.
Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
Message : The term 'Connect-PnPOnline' is not recognized as a name of a cmdlet, function, script file, or executable program.
Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
Any advice?
Thanks
Beta Was this translation helpful? Give feedback.
All reactions