1
我想并行执行将在其中一个VM上触发的微任务,并且应该在所有VM上并行化。我如何修改Azure批处理队列。有什么方法通过API将任务添加到队列中?Azure批处理microtask并行处理(修改任务队列)
我想并行执行将在其中一个VM上触发的微任务,并且应该在所有VM上并行化。我如何修改Azure批处理队列。有什么方法通过API将任务添加到队列中?Azure批处理microtask并行处理(修改任务队列)
有什么办法通过API向队列添加任务吗?
如果您使用Azure Batch .NET Library,则可以使用以下代码将任务添加到作业。
private static async Task<List<CloudTask>> AddTasksAsync(
BatchClient batchClient,
string jobId,
string taskId,
List<ResourceFile> inputFiles,
string taskCommand)
{
// Create a collection to hold the tasks that we'll be adding to the job
List<CloudTask> tasks = new List<CloudTask>();
CloudTask task = new CloudTask(taskId, taskCommand);
task.ResourceFiles = inputFiles;
tasks.Add(task);
await batchClient.JobOperations.AddTaskAsync(jobId, tasks);
return tasks;
}
如果您想使用REST API,以下链接供您参考。
如果你使用上面的API时遇到任何问题,请随时告诉我。