Welcome to the Microsoft Q&A forum.
The issue you're facing is due to how SharePoint handles special characters, even when URL-encoded. While you're encoding the
#
to%23
, SharePoint internally might be double-encoding or interpreting it differently, leading to the "file not found" error. Renaming the files is a last resort.
Please Check the below steps and confirm us
- URL Encoding: Ensure that the
#
character is correctly URL encoded as%23
. It seems like you've already done this, but double-checking might help. - Using SharePoint API: Instead of directly using the URL, you can try using the SharePoint REST API to search for files. This can sometimes bypass issues with special characters. For example:
https://myorganisation.sharepoint.com/sites/MySPOSite/_api/web/GetFolderByServerRelativeUrl('/sites/MySPOSite/Shared Documents/Backup Files/Oct2024')/Files?$filter=Name eq 'Y#skp621[202410270005].log'
- Power Automate: Use Power Automate (formerly Microsoft Flow) to rename the files temporarily, copy them to Azure Blob Storage, and then rename them back. This can be automated to handle multiple files.
- Azure Function: Create an Azure Function that renames the files before copying them to Blob Storage. This can be integrated into your ADF pipeline.
- Custom Script: Write a custom script (e.g., PowerShell, Python) to handle the file renaming and copying process. This script can be triggered within your ADF pipeline.
- Check SharePoint Permissions: While less likely, double-check that the account used by your ADF pipeline has the necessary permissions to access the files in SharePoint, especially those with special characters in their names.
I hope the above steps will resolve the issue, please do let us know if issue persists. Thank you