In my Pipeline, I have a Stage that runs a Powershell script that sends a find command to my app service (Linux) to delete files in /home/site/wwwroot
.
$bodyToPOST = @{
command = "find . -mindepth 1 -delete"
dir = "/home/site/wwwroot"
}
# Splat all parameters together in $param
$param = @{
# command REST API url
Uri = "/api/command"
Headers = @{Authorization=("Basic {0}" -f $base64AuthInfo)}
Method = "POST"
Body = (ConvertTo-Json $bodyToPOST)
ContentType = "application/json"
}
# Invoke REST call
Invoke-RestMethod @param
I have a folder named méli-mélo
and it seems to be causing an error. How would I formulate my find to not have this happen? Or is this due to another configuration issue?
2025-03-18T16:28:43.8003793Z [32;1mError : [0mfind: ‘./plugins/path/to/\351li-m\351lo’: No such file or directory
2025-03-18T16:28:43.8005976Z [32;1m [0mfind: cannot delete ‘./plugins/path/to/m\351li-m\351lo’: No such file or directory
There seems to be an encoding process that kicks in, converting the accented é
to their unicode equivalents?
Update #1
Running the command manually on the app service (via SSH or Bash tabs) actually worked:
In my Pipeline, I have a Stage that runs a Powershell script that sends a find command to my app service (Linux) to delete files in /home/site/wwwroot
.
$bodyToPOST = @{
command = "find . -mindepth 1 -delete"
dir = "/home/site/wwwroot"
}
# Splat all parameters together in $param
$param = @{
# command REST API url
Uri = "https://app.service.url/api/command"
Headers = @{Authorization=("Basic {0}" -f $base64AuthInfo)}
Method = "POST"
Body = (ConvertTo-Json $bodyToPOST)
ContentType = "application/json"
}
# Invoke REST call
Invoke-RestMethod @param
I have a folder named méli-mélo
and it seems to be causing an error. How would I formulate my find to not have this happen? Or is this due to another configuration issue?
2025-03-18T16:28:43.8003793Z [32;1mError : [0mfind: ‘./plugins/path/to/\351li-m\351lo’: No such file or directory
2025-03-18T16:28:43.8005976Z [32;1m [0mfind: cannot delete ‘./plugins/path/to/m\351li-m\351lo’: No such file or directory
There seems to be an encoding process that kicks in, converting the accented é
to their unicode equivalents?
Update #1
Running the command manually on the app service (via SSH or Bash tabs) actually worked:
Share Improve this question edited Mar 20 at 13:52 TechFanDan asked Mar 19 at 14:07 TechFanDanTechFanDan 3,51210 gold badges52 silver badges91 bronze badges1 Answer
Reset to default 1Yes, looks like, the problem is caused by the folder name (méli-mélo
) that contains non English characters, and the character é
was convert to numeric character reference. If you manually execute the same find
command directly on the Console of your Azure Web App, you might get the same issue.
To delete the folder "méli-mélo
", you can try to execute a rm
command to delete it individually under the directory "/home/site/wwwroot
". Then execute the find
command to delete other folders.
rm -r "méli-mélo"
find . -mindepth 1 -delete
After successfully clear all files and folders from the web app, in the future deployments, you can consider naming the folders with general English characters to avoid this issue.
If the rm
command also cannot work, you might need to delete the whole web app, and then create a new web app on the Azure Portal. Same, in the future deployments, you can consider naming the folders with general English characters to avoid this issue.