Power BI Refresh Error:
Fabric Pipeline Error 2504
What does this error mean?
The Azure Batch activity returned a BadRequest status because the total size of file paths in the folderPath exceeds the 32,768-character limit for resourceFiles. Reduce the number of files or compress them into a zip archive.
Common causes
- 1Too many individual files listed in the folderPath for the Azure Batch activity, causing the resourceFiles string to exceed 32,768 characters
- 2Deep or lengthy folder paths that consume the character limit even with a moderate number of files
- 3Incremental file accumulation in the target folder over time that eventually crosses the limit
- 4No file cleanup or archiving strategy in place for the Batch resource directory
How to fix it
- 1Step 1: Audit the folderPath used in the Azure Batch activity and count the number of files; identify any files that are not required for the current execution.
- 2Step 2: Remove unnecessary files from the folderPath in Azure Storage, or move them to an archive container that is not referenced by the activity.
- 3Step 3: Compress remaining required files into a single zip archive and upload it to the folderPath, reducing the total number of resource file entries.
- 4Step 4: Add an unzip command to your Batch activity command line, for example: powershell.exe -nologo -noprofile -command "& { Add-Type -A 'System.IO.Compression.FileSystem'; [IO.Compression.ZipFile]::ExtractToDirectory($zipFile, $folder); }" ; $folder\yourProgram.exe
- 5Step 5: Re-run the pipeline and monitor that the total resourceFiles path length stays well below 32,768 characters to avoid recurrence.