0
votes

I have setup a azure batch which is a User Subscription type. Pool is already setup with 3 nodes which are in idle state. from my c# code I get the pool reference and run StartTask and do CommitAsync.

Does this caused the StartTask to run or will StartTask only be executed when the node tires to join the pool.

pool = batchClient.PoolOperations.GetPool(poolId);
pool.StartTask = new StartTask
{
    CommandLine = "cmd /c (robocopy %AZ_BATCH_TASK_WORKING_DIR% %AZ_BATCH_NODE_SHARED_DIR%) ^& IF %ERRORLEVEL% LEQ 1 exit 0",
    ResourceFiles = resourceFiles,
    WaitForSuccess = true
};

When I run this code it does not seem to copy the required files to Node shared directory.

1

1 Answers

0
votes

As documented, a Start Task runs when a node joins a pool, reboots or is reimaged.