本文介绍了Kudu部署后命令未运行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的网站(通过kudu)部署到蔚蓝之后,我正在尝试运行一些脚本

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

我具有以下目录结构

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

.deployment看起来像这样:

.deployment looks like this:

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

deploy.cmd与azure site deploymentscript --aspWAP pathToYourWebProjectFile.csproj -s pathToYourSolutionFile.sln生成的内容相同( http://blog.amitapple.com/post/38418009331/azurewebsitecustomdeploymentpart2/#.VPYd_PmUeTI )

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)

但是test.bat没有被调用.

However test.bat is not getting called.

我尝试同时设置POST_DEPLOYMENT_ACTION_DIR和SCM_POST_DEPLOYMENT_ACTIONS_PATH(请参见 https://github.com/projectkudu/kudu/issues/1154 )

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

推荐答案

某些站点扩展"在Azure内部重新配置此行为.

Some "Site Extensions" reconfigure this behaviour inside Azure.

例如,如果您在PHP网站中使用Composer网站扩展,默认的kudu部署脚本被Composer Site Extension注入的其他脚本替换.

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.

也许这是您的情况.

查看您的COMMAND环境变量.

Look at your COMMAND environment variable.

这篇关于Kudu部署后命令未运行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-25 01:12