nerdexam
Microsoft

AZ-204 · Question #176

You have the following code (line numbers are included for reference only): BatchTokenCredentials = GetCredentialsf); BatchClient client^ BatchClient.Open(credentials); CloudJob job =…

The correct answer is A. Add the following code between lines 02 and 03: var pool = client. PoolOperations.CreatePool(); B. Add the following code between lines 03 and 04: job. Pool I nformation. Pool I d = pool. Id. You should add the following code between lines 02 and 03: var pool = client.PoolOperations.CreatePool(); This creates a batch pool. A pool is a set of virtual machines (VMs) for running batch jobs. You should also add the following code between lines 03 and 04: job. Pool…

Submitted by krish.m· Mar 30, 2026Develop Azure compute solutions

Question

You have the following code (line numbers are included for reference only): BatchTokenCredentials = GetCredentialsf); BatchClient client^ BatchClient.Open(credentials); CloudJob job = client.JobOperations.CreateJobf); CloudTask task = new CloudTask("sampleTask", "cmd /c SampleTask.exe"); job. AddTask(task); job.Commit(); You need to ensure that the SampleTask.exe process runs. Which two actions should you perform? Each answer presents part of the complete solution.

Options

  • AAdd the following code between lines 02 and 03: var pool = client. PoolOperations.CreatePool();
  • BAdd the following code between lines 03 and 04: job. Pool I nformation. Pool I d = pool. Id;
  • CModify line 05 as follows:
  • DRemove line 06.

How the community answered

(43 responses)
  • A
    70% (30)
  • C
    21% (9)
  • D
    9% (4)

Explanation

You should add the following code between lines 02 and 03: var pool = client.PoolOperations.CreatePool(); This creates a batch pool. A pool is a set of virtual machines (VMs) for running batch jobs. You should also add the following code between lines 03 and 04: job. Pool Information. Poolld = This allows you to assign the job to the pool you created. A job cannot run outside of a pool. You should not remove line 06. The Commit method creates the job in Azure. You should not modify line 05 as follows: clientJobOperations.AddTask(MSampleTask", task); You can either use client.JobOperations.AddTask or job.AddTask. Using the former, you must specify the ID of the job to which the task applies. In this scenario, you did not create a job with an ID named SampleTask.

Topics

#Azure Batch#pool configuration#CloudJob#BatchClient

Community Discussion

No community discussion yet for this question.

Full AZ-204 Practice