【发布时间】:2017-11-22 12:06:47
【问题描述】:
我是 Azure 批处理的新手。我必须在池中的节点上执行一项任务。
我使用的方法是我拥有想要在节点上运行的代码。我正在制作 .class 文件 jar 的 zip 并上传到我的 Azure 存储帐户,然后获取应用程序 ID 并将其放入 ApplicationPackageReference 并添加到我的工作任务中。
String applicationId= "TaskPerformApplicationPack";
ApplicationPackageReference reference = new ApplicationPackageReference().withApplicationId(applicationId);
List<ApplicationPackageReference> list = new ArrayList<ApplicationPackageReference>();
list.add(reference);
TaskAddParameter taskToAdd = new TaskAddParameter().withId("mytask2").withApplicationPackageReferences(list);
taskToAdd.withCommandLine(String.format("java -jar task.jar"));
batchClient.taskOperations().createTask(jobId, taskToAdd);
现在当我运行它时,我的任务失败并给出一个错误
对指定 Azure Blob 之一的访问被拒绝
如何使用 azure 批处理作业任务在节点上运行特定代码?
【问题讨论】:
标签: azure azure-storage azure-batch