我踢了每下面的啓動腳本在我ServiceDefinition.csdef中Azure的部署失敗,因爲啓動腳本
<Startup>
<Task commandLine="Microsoft.WindowsAzure.Caching\ClientPerfCountersInstaller.exe install" executionContext="elevated" taskType="simple" />
<Task commandLine="startup.cmd" executionContext="elevated" taskType="simple" />
</Startup>
的STARTUP.CMD文件
@echo off
REM StartupLog.txt can be found at (E or F):\approot\bin
Echo Copying MyUtil to system root >> StartupLog.txt 2>&1
copy /y MyUtil.exe %SystemRoot% >> StartupLog.txt 2>&1
IF ERRORLEVEL 1 GOTO ErrorExit
REM It's ok if the next fails, the task may not be scheduled 1st time
Echo Trying to delete MyUtil from scheduler >> StartupLog.txt 2>&1
schtasks /Delete /F /TN "MyUtil" >> StartupLog.txt 2>&1
Echo Adding MyUtil to Scheduler >> StartupLog.txt 2>&1
schtasks /Create /SC MINUTE /MO 2 /SD 11/01/2012 /TN "MyUtil" /TR %SystemRoot%\MyUtil.exe >> StartupLog.txt 2>&1
IF ERRORLEVEL 1 GOTO ErrorExit >> StartupLog.txt 2>&1
GOTO End
:ErrorExit
REM Report the date, time, and ERRORLEVEL of the error.
%ERRORLEVEL% >> StartupLog.txt 2>&1
DATE /T >> StartupLog.txt 2>&1
TIME /T >> StartupLog.txt 2>&1
ECHO An error occurred during startup. ERRORLEVEL = %ERRORLEVEL% >> StartupLog.txt 2>&1
ECHO ----------------------------------------------------------- >> StartupLog.txt 2>&1
EXIT /B 1
:End
ECHO Exiting at end with 0 >> StartupLog.txt 2>&1
ECHO ----------------------------------------------------------- >> StartupLog.txt 2>&1
EXIT /B 0
中的錯誤( 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,直到我可以解決這個問題。
什麼是** ERRORLEVEL **?你應該[輸出到日誌文件'>>「%TEMP%\ StartupLog.txt」'](http://msdn.microsoft.com/en-us/library/windowsazure/hh974418.aspx) – SliverNinja
奇怪的是,沒有任何東西寫入StartupLog.txt。當我的RDP進入機器%TEMP%時是'D:\ Users \ \ AppData \ Local \ Temp \ 2'。我搜索了整個虛擬機「StartupLog.txt」 - 什麼都沒有! –
DeepSpace101