Replies: 1 comment
-
Try to replicate it locally on your machine. You can use |
Beta Was this translation helpful? Give feedback.
0 replies
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.
-
Hi,
I have a business need where I need to create an Azure Function App to download specific files from SharePoint (SP) and then do what we need with them. I am using the Function App's Managed Identity (MI) to connect and that works fine. I have given my MI the SharePoint permissions of Sites.FullControl.All (might change later if needed).
Yesterday (19th August 2025), the script worked fine. I was able to connect to SP and download the file using
Get-PnPFile -Url $sharePointFileUrl -Path $env:TEMP -FileName $fileName -AsFile -Force
fine and then do what I need. However, today all of a sudden nothing worked. I have spent countless hours trying to resolve with different error messages and now the latest which I've been stuck on for ages is the below;ERROR: Failed to download file from SharePoint: SharePoint Rest service exception Exception : Type : Microsoft.PowerShell.Commands.WriteErrorException Message : Failed to download file from SharePoint: SharePoint Rest service exception HResult : -2146233087 CategoryInfo : NotSpecified: (:) [Write-Error], WriteErrorException FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,_PropelITFileTransfer_ InvocationInfo : MyCommand : _PropelITFileTransfer_ HistoryId : 1 InvocationName : _PropelITFileTransfer_ CommandOrigin : Internal ScriptStackTrace : at <ScriptBlock>, C:\home\site\wwwroot\PropelITFileTransfer\run.ps1: line 110
I have tried a few things like changing the authentication to use a certificate but that didn't work so I'm back at my MI, I have tried different files in the same location as well as different SP sites but still same error.
Any ideas to get this resolved would be greatly appreciated!
Thanks.
Beta Was this translation helpful? Give feedback.
All reactions