0
votes

Is there a way to view the Azure Web role Startup task logs. Do we need to explicitly enable remote desktop to view the logs?.

Invoking a batch file as part of start of our cloud service. Below sample batch file where we are printing information on console

SET LogFileDir=%DiagnosticStore%LogFiles\StartupTask\
echo "Starting .PS1">> "%LogFilePath%" 2>>&1
....

CSDEF config changes

<Startup>
  <Task commandLine="Startup\global.cmd" executionContext="elevated" taskType="simple">        
  </Task>
</Startup>
1

1 Answers

0
votes

RDP is the easiest, but you can also configure Azure Diagnostics to capture these logs and push them to Blob storage. You would configure a Directories entry in your Azure Diagnostics configuration, and then direct your logfile to that specific directory. You can see more info about this configuration at https://docs.microsoft.com/en-us/visualstudio/azure/vs-azure-tools-diagnostics-for-cloud-services-and-virtual-machines?view=vs-2019#log-directories.