Hi nish-1910,
When i run "Add-PnPFile" cmdlet in Azure runbook, i am able to reproduce the issue like below:
At last i fix it via following script:
$PSCredentials=Get-AutomationPSCredential -Name 'sharepointlogincred'
$con = Connect-PnPOnline -Url 'https://xxx.sharepoint.com/sites/s01' -Credentials $PSCredentials
# first file
$filepath= $env:temp+ "\file-example_PDF_500_kB.pdf"
Write-Output $filepath
Invoke-WebRequest -Uri "https://file-examples-com.github.io/uploads/2017/10/file-example_PDF_500_kB.pdf" -OutFile $filepath
$addfile = Add-PnPFile -Path $filepath -Folder "Shared Documents"
# second file
$filepath01= $env:temp+ "\file_example_PPT_500kB.ppt"
Write-Output $filepath01
Invoke-WebRequest -Uri "https://file-examples-com.github.io/uploads/2017/08/file_example_PPT_500kB.ppt" -OutFile $filepath01
$addfile = Add-PnPFile -Path $filepath01 -Folder "Shared Documents"
# 3rd file
$filepath02= $env:temp+ "\file_example_PNG_1MB.png"
Write-Output $filepath02
Invoke-WebRequest -Uri "https://file-examples-com.github.io/uploads/2017/10/file_example_PNG_1MB.png" -OutFile $filepath02
$addfile = Add-PnPFile -Path $filepath02 -Folder "Shared Documents"
Below thread shared some tips that might be helpful to this issue:
Best Regards, Baker Kong