azureazure-batch

Are task logs deleted when the node is deleted due to autoscaling in Azure Batch service?


I am trying to access the logs (stdout.txt and stderr.txt) of the tasks run.

As soon as the task is completed I lose access to those files. Looking at the browser console, if I search a file in the path field I get a 404 error, NodeNotFound, The specified node does not exist.

Is it caused because the node is deleted when the task completes? Is there a way to retain those files after the node is deleted?

Thanks in advance.

P.S.: Also asked in the Microsoft Learn platform (https://learn.microsoft.com/en-us/answers/questions/1820060/are-task-logs-deleted-when-the-node-is-deleted-due).


Solution

  • Are task logs deleted when the node is deleted due to autoscaling in Azure Batch service?

    The above query is solved in MS-Q&A by Prrudram-MSFT.

    Posting it an answer so that it will help community to find better solution.

    Is it caused because the node is deleted when the task completes? Is there a way to retain those files after the node is deleted?

    Regarding your question, you can save the log files using Task output files. Task output files provide a convenient way to save log files to Azure Storage. By specifying the output files in the task definition, Batch will automatically upload the files to your storage account when the task completes.

    Reference: Persist job and task output to a data store - Azure Batch | Microsoft Learn