in addition to @Divyesh Govaerdhanan 's answer,
if you are deploying this from a pipeline, you can have this option checked if it is unchecked in azure pipeline "app service deploy" task
Remove additional files at destination
You can use this task in yml pipeline. kindly reference for more information https://learn.microsoft.com/en-us/azure/devops/pipelines/tasks/reference/azure-rm-web-app-deployment-v4?view=azure-pipelines
- task: AzureRmWebAppDeployment@4
inputs:
ConnectionType: 'AzureRM'
azureSubscription: 'your-subscription'
appType: 'webApp'
WebAppName: 'your-app-name'
packageForLinux: '$(System.DefaultWorkingDirectory)/**/*.zip'
RemoveAdditionalFilesFlag: true # This is the key setting