0
votes

How to delete files in Azure kudu after the deployment ? I wrote some Powershell script using Azure app service deploy task after the deployment using post deployment action step but I couldn't able to delete the files. I have simple-test.log and simeple.txt files exist in azure kudu.Please help me to solve this issue. Script:

if((Test-Path 'D:\home\site\wwwroot')) 
{
   rm simple*   
   Write-Host "Simple log file is exist,removed"
}

KUDU Log:

KUDU LOG FILES

Deployment Log Snap

1

1 Answers

0
votes

using kudu you would need to put it under site\deployments\tools\PostDeploymentActions. then kudu will run it after every deployment automatically. All the ps1, bat, cmd under that directory would be run by kuku

you can also put it to a custom directory, but you'd need to tell kudu where to get it by setting this setting: SCM_POST_DEPLOYMENT_ACTIONS_PATH.

Reading: https://github.com/projectkudu/kudu/wiki/Post-Deployment-Action-Hooks