Deployment 由于启动脚本,Azure部署失败

Deployment 由于启动脚本,Azure部署失败,deployment,azure,startupscript,Deployment,Azure,Startupscript,我正在根据我的ServiceDefinition.csdef中的以下内容启动启动脚本 <Startup> <Task commandLine="Microsoft.WindowsAzure.Caching\ClientPerfCountersInstaller.exe install" executionContext="elevated" taskType="simple" /> <Task commandLine="startup.cmd" execut

我正在根据我的ServiceDefinition.csdef中的以下内容启动启动脚本

<Startup>
  <Task commandLine="Microsoft.WindowsAzure.Caching\ClientPerfCountersInstaller.exe install" executionContext="elevated" taskType="simple" />
  <Task commandLine="startup.cmd" executionContext="elevated" taskType="simple" />
</Startup>
(E:或F:)\approot\bin中的错误为:

Copying MyUtil to system root                                                        
        1 file(s) copied.
Trying to delete MyUtil from scheduler                                                
SUCCESS: The scheduled task "MyUtil" was successfully deleted.
Adding MyUtil to Scheduler                                                            
ERROR: No mapping between account names and security IDs was done.

(43,4):LogonType:'1' is not recognized as an internal or external command,
operable program or batch file.

如果我在RDPing到WebRole之后运行startup.cmd文件,那么任务就可以添加到调度程序中。由于某些原因,它在部署时总是失败。有人知道如何解决这个问题吗?在修复此问题之前,我已恢复为OSVersion=2。

原因可能是执行脚本的用户(尚未)没有AppData目录。您可以尝试在启动任务的顶部添加这些吗

md "%~dp0appdata"
reg add "hku\.default\software\microsoft\windows\currentversion\explorer\user shell folders" /v "Local AppData" /t REG_EXPAND_SZ /d "%~dp0appdata" /f

我遇到了完全相同的问题,在浪费了几个小时认为这是权限问题之后,结果发现它需要在指定为/TR参数的路径周围加上双引号。实际上我有命令行参数,所以我需要像“appname.exe”“parameter”那样指定它

和你一样,我在我的任务中使用了环境变量——这可能是相关的,尽管我不知道为什么。和您一样,当以我的RDP用户身份启动时,该任务运行良好,但在系统下作为实际启动任务运行时失败


我知道几个月过去了,所以你可能已经离开了这个问题,但我很好奇这些引用是否也为你解决了这个问题(以及加分,解释它为什么会在乎!)。

错误级别是多少?奇怪的是,StartupLog.txt中没有写入任何内容。当我将RDP导入计算机时%TEMP%为
D:\Users\\AppData\Local\TEMP\2
。我在整个虚拟机中搜索了
StartupLog.txt
-什么都没有!没有帮助,仍然没有输出,脚本仍然失败。我知道你的水平=0,因为通常11分钟的部署持续约1小时。我还升级了OSFamily=3,所以我们使用的是Windows(Azure)Server 2012,但问题仍然是一样的。知道启动脚本在哪个帐户下运行吗?RDP用户?我需要一种更快的方式来触发启动脚本exec,而不是完全重新部署来快速调试。。。
md "%~dp0appdata"
reg add "hku\.default\software\microsoft\windows\currentversion\explorer\user shell folders" /v "Local AppData" /t REG_EXPAND_SZ /d "%~dp0appdata" /f