【问题标题】:How to list all tasks in an Azure Batch account using the .NET API?如何使用 .NET API 列出 Azure Batch 帐户中的所有任务?
【发布时间】:2019-08-05 03:20:49
【问题描述】:

在我的 Azure Batch 帐户中,我同时运行许多作业。如何获得所有作业的所有任务?

【问题讨论】:

    标签: c# azure azure-batch


    【解决方案1】:

    使用BatchClient.JobOperationsListJobs()ListTasks()

    using Microsoft.Azure.Batch;
    using Microsoft.Azure.Batch.Auth;
    /*...*/
    
    var BatchClient = BatchClient.Open(new BatchSharedKeyCredentials(
      "<your-batch-endpoint>", 
      "<your-batch-account-name>", 
      "<your-shared-key>"));
    var jobs = BatchClient.JobOperations.ListJobs();
    var tasks = jobs.SelectMany(job => BatchClient.JobOperations.ListTasks(job.Id));
    

    【讨论】:

    猜你喜欢
    • 2017-12-29
    • 1970-01-01
    • 2021-08-19
    • 1970-01-01
    • 2014-05-02
    • 2019-12-05
    • 2018-11-10
    • 1970-01-01
    • 2015-03-17
    相关资源
    最近更新 更多