Practice Exam

Question 29 of 75

Configure Azure Batch Output File Upload Condition

You work as a Batch Processing Developer for MDFT Pro, a well-known training agency that provides certification courses to students globally. Mark, the Systems Integration Lead, has tasked you with developing an Azure Batch solution that processes and converts student assignment submissions stored in Azure Storage.

The system needs to batch convert video presentations, PDF documents, and code projects submitted by students into standardized formats for grading and archival. You’ve created a function called StartTasks that accepts three parameters:

Parameter nameDescription
fileTasksa list of tasks to be run
jobIdthe identifier that must be assigned to the job
outputContainerSasUrla storage SAS URL to store successful converted files

When one document has corrupted data and fails conversion, you still need to ensure all other successfully converted files are uploaded to the output container. Only successfully converted files should be placed in the container referenced by the outputContainerSasUrl parameter. Failed conversions should not be stored to avoid filling the container with invalid data.

How should you complete the code to configure the output file upload condition?

public List<CloudTasks> StartTasks(List<FileTask> fileTasks, string jobId, string outputContainerSasUrl)
{
	// job setup code goes here
	// ...

	fileTasks.ForEach((fileTask) =>
	{
		var taskId = DateTime.Now.ToFileTimeUtc().ToString();
		var task = new CloudTask(taskId, fileTask.Command);
		var files = new List<OutputFile>();
		var outputContainer = new OutputFileBlobContainerDestination(outputContainerSasUrl);
		files.Add(
			new OutputFile(
				fileTask.Output,
				new OutputFileDestination(outputContainer),
				new OutputFileUploadOptions(OutputFileUploadCondition._________)
			)
		);
	}
}

Choose the correct answer from the options below.

Explanations for each answer:

Learn more about Batch Task Output Files:
Persist Task Output
Next Question
Discuss this question on social media: