2

I'm trying to run some scripts after my site is deployed to azure (via kudu)

I have the following directory structure

-solution
  - .deployment
  - deploy.cmd 
    - deployment
       - postdeployactions
         - test.bat

.deployment looks like this:

[config]
POST_DEPLOYMENT_ACTION_DIR  = deployment\postdeployactions\
command = deploy.cmd

deploy.cmd is unmodified from the one generated by azure site deploymentscript --aspWAP pathToYourWebProjectFile.csproj -s pathToYourSolutionFile.sln (http://blog.amitapple.com/post/38418009331/azurewebsitecustomdeploymentpart2/#.VPYd_PmUeTI)

However test.bat is not getting called.

I have tried setting both POST_DEPLOYMENT_ACTION_DIR and SCM_POST_DEPLOYMENT_ACTIONS_PATH (see https://github.com/projectkudu/kudu/issues/1154)

undefined
  • 33,537
  • 22
  • 129
  • 198
  • @AAlferez not using the .deployment file sadly, afaik it doesnt do anything. This setting does work if you add it as an appsetting in azure though – undefined Nov 08 '15 at 20:20
  • I actually did add the file .deployment to my root repo and it gets executed! POST_DEPLOYMENT_ACTION_DIR = site\deployments\tools\PostDeploymentActions – AAlferez Nov 09 '15 at 19:41
  • @LukeMcGregor: **Which setting did you set** in your app settings? The `SCM_POST_DEPLOYMENT_ACTIONS_PATH` or the `POST_DEPLOYMENT_ACTION_DIR`? I have the first one and it used to run my custom batch file in the folder configured, but for some reason this stopped working about 2 months ago or so and I haven't changed anything about files/settings that could impact non-execution? **And which folder path** did you include? from `home\site\repository\...` or or from `site\repository\...` or... What's root for this setting? – Robert Koritnik Feb 16 '16 at 00:24

2 Answers2

2

Some "Site Extensions" reconfigure this behaviour inside Azure.

For example, if you use Composer Site Extension in a PHP Web Site, default kudu deployment script is replaced by other script injected by Composer Site Extension.

Maybe this could be your case.

Look at your COMMAND environment variable.

dmoreno
  • 100
  • 1
  • 10
0

I do exactly the same thing but instead of POST_DEPLOYMENT_ACTION_DIR I use SCM_POST_DEPLOYMENT_ACTIONS_PATH, could that be the issue?

[config]
SCM_POST_DEPLOYMENT_ACTIONS_PATH = deployment\postdeployactions\
Andy Mehalick
  • 993
  • 8
  • 19