I want that when a job executes, in azure batch service, in case of an error to be able to correct data and then from portal just reactivate the task. The tasks are scheduled.
Currently I am just throwing Exceptions in case of failure. Those tasks cannot be reactivated.
But looking at other tasks I see this "Task failed "The task exited with an exit code representing a failure"" For that task I can click on 'Reactivate' button. How can I do the same?
This is my current code:
public class Program
{
private static void Main(string[] args)
{
try
{
ConsoleLogger.Info($"Job.DataTransfer process started! ");
DataTransferSettings dataTransferSettings = DataTransferSettingsReader.GetDataTransferSettings();
if (dataTransferSettings != null)
{
ServicePointManager.DefaultConnectionLimit = int.MaxValue;
CopyData(dataTransferSettings);
}
else
{
throw new Exception($"Process stopped, check data transfer settings.");
}
ConsoleLogger.Info($"Job.DataTransfer process completed.");
}
catch (Exception ex)
{
ConsoleLogger.Error(GetExceptionMessage(ex), ex);
ExceptionDispatchInfo.Capture(ex).Throw();
}
}
}
I just didn't found yet any solution on how to do this.