Folder encoding issue on Linux App Service using AzureRmWebAppDeployment/KuduSync
Danny Fournier
0
Reputation points
Our pipeline introduces, for a reason unknown to us, a folder encoding issue in our Linux App Service during deployment.
Once our app is deployed, a folder "méli-mélo" will get deployed as 'm'$'\351''li-m'$'\351''lo'.
ls -la
d????????? ? ? ? ? ? 'm'$'\351''li-m'$'\351''lo'
- No issues from the DevOps Repository
- No issues from our local environments (VSCode/Docker, PHP 8.2 FPM, Debian Slim?)
- No issues from the artifact (downloaded and extracted in our Docker local environment)
Log showing the usage of KuduSync:
[
{
"log_time": "2025-06-16T15:35:24.2887097Z",
"id": "",
"message": "Command: \"/home/site/deployments/tools/deploy.sh\"",
"type": 0,
"details_url": null
},
{
"log_time": "2025-06-16T15:35:24.3349317Z",
"id": "",
"message": "Handling Basic Web Site deployment.",
"type": 0,
"details_url": null
},
{
"log_time": "2025-06-16T15:35:24.4060169Z",
"id": "",
"message": "Kudu sync from: '/tmp/zipdeploy/extracted' to: '/home/site/wwwroot'",
"type": 0,
"details_url": null
},
...
{
"log_time": "2025-06-16T15:46:51.4061573Z",
"id": "",
"message": "Processed 11852 files...",
"type": 0,
"details_url": null
},
{
"log_time": "2025-06-16T15:46:58.5474741Z",
"id": "",
"message": "Finished successfully.",
"type": 0,
"details_url": null
}
]
Pipeline YAML that uses AzureRmWebAppDeployment@5 (KuduSync?) to deploy
trigger:
- master
variables:
# Azure Resource Manager connection created during pipeline creation
azureSubscription: 'our_sub'
azureResourceGroup: 'our_rg'
azureSelfHostedAgent: 'our-win2019-agent'
# Web app name
webAppName: 'our-app-service'
# Agent VM image name
vmImageName: 'ubuntu-24.04'
# Environment name
environmentName: 'our-app-service'
# Root folder under which your composer.json file is available.
rootFolder: $(System.DefaultWorkingDirectory)
stages:
- stage: Build
displayName: Build stage
variables:
phpVersion: '8.2'
jobs:
- job: Buildjob
pool:
vmImage: $(vmImageName)
steps:
- bash: |
echo "##vso[task.setvariable variable=short_hash]${BUILD_SOURCEVERSION:0:8}"
- bash: |
echo "##vso[task.setvariable variable=long_hash]${BUILD_SOURCEVERSION}"
- script: |
sudo update-alternatives --set php /usr/bin/php$(phpVersion)
sudo update-alternatives --set phar /usr/bin/phar$(phpVersion)
sudo update-alternatives --set phpdbg /usr/bin/phpdbg$(phpVersion)
sudo update-alternatives --set php-cgi /usr/bin/php-cgi$(phpVersion)
sudo update-alternatives --set phar.phar /usr/bin/phar.phar$(phpVersion)
php -version
workingDirectory: $(rootFolder)
displayName: 'Use PHP version $(phpVersion)'
- script: composer install --no-interaction --prefer-dist
workingDirectory: $(rootFolder)
displayName: 'Composer install'
- script: |
cp config/app_local.azure.php config/app_local.php
sed -i 's/__SALT__/$(__SALT__)/g' config/app_local.php
sed -i 's/__HOST__/$(__HOST__)/g' config/app_local.php
sed -i 's/__USER__/$(__USER__)/g' config/app_local.php
sed -i 's/__PASSWORD__/$(__PASSWORD__)/g' config/app_local.php
sed -i 's/__DB__/$(__DB__)/g' config/app_local.php
sed -i 's/__DEBUG__/false/g' config/app_local.php
sed -i 's,__FULLBASEURL__,$(__FULLBASEURL__),g' config/app_local.php
sed -i 's/__ENVIRONMENT__/$(__ENVIRONMENT__)/g' config/app_local.php
sed -i 's/__SHORTGITCOMMIT__/$(short_hash)/g' config/app_local.php
sed -i 's/__LONGGITCOMMIT__/$(long_hash)/g' config/app_local.php
sed -i 's/__SDI_DB__/$(__SDI_DB__)/g' config/app_local.php
rm -f composer.json
rm -f composer.lock
rm -rf .git
workingDirectory: $(rootFolder)
displayName: 'PreBuild'
- task: ArchiveFiles@2
displayName: 'Archive files'
inputs:
rootFolderOrFile: '$(rootFolder)'
includeRootFolder: false
archiveType: zip
archiveFile: $(Build.ArtifactStagingDirectory)/$(Build.BuildId).zip
replaceExistingArchive: true
- task: CopyFiles@2
inputs:
Contents: '*.ps1'
TargetFolder: '$(Build.ArtifactStagingDirectory)'
- publish: $(Build.ArtifactStagingDirectory)
displayName: 'Upload package'
artifact: drop
- job: DeployJob
pool: '$(azureSelfHostedAgent)'
workspace:
clean: all
steps:
- checkout: none
- task: DownloadPipelineArtifact@2
inputs:
artifact: drop
path: $(System.DefaultWorkingDirectory)
- task: AzurePowerShell@5
displayName: 'Clean Azure App Service'
inputs:
azureSubscription: '$(azureSubscription)'
ScriptPath: '$(System.DefaultWorkingDirectory)/SandBoxCleanup.ps1'
azurePowerShellVersion: LatestVersion
pwsh: true
workingDirectory: '$(System.DefaultWorkingDirectory)'
- task: AzureRmWebAppDeployment@5
displayName: 'Deploy Azure App Service'
inputs:
azureSubscription: '$(azureSubscription)'
appType: '$(WebAppKind)'
WebAppName: '$(WebAppName)'
ResourceGroupName: '$(azureResourceGroup)'
packageForLinux: '$(System.DefaultWorkingDirectory)/*.zip'
CleanDeploymentFlag: true
RemoveAdditionalFilesFlag: true
DeploymentTypeLinux: 'oneDeploy'
dependsOn: BuildJob
Azure App Service
Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
8,930 questions
Sign in to answer