0

I am trying Azure Batch services and followed this example.

I was trying to download a webpage so I changed the task into something like

az batch task create  --task-id mytask  --job-id myjob --command-line "/bin/bash -c 'curl http://www.google.com'"

However, I find this cannot run properly after I add this task. Would anyone kindly help me figure out what is happening? Thanks so much!

James Z
  • 12,209
  • 10
  • 24
  • 44

1 Answers1

0

First of all, the link you post is lost and cannot see it. And then you can follow the quickstart of the Azure Batch Service to learn it. With the command curl http://www.google.com I have done the test and the task works well. You can follow the document to download the stdout.txt file to see the output of the task with the command. My test result here:

enter image description here

I also test it on my local ubuntu machine and the same as it. So there is no problem with the quickstart of the Azure Batch Service. Maybe you should wait for a steady state pool when you want to execute the task.

Charles Xu
  • 29,862
  • 2
  • 22
  • 39
  • Thanks Charles! This is very helpful. Would you mind answering two short questions? First, how can I install a package properly. For example, if I do az batch task create --task-id testtask --job-id testjob --command-line "/bin/bash -c 'apt-get update && apt-get install parallel'" what I get from stderr file is permission problems. Second, I notice that the output is stored in the outstd.txt, if I try -o or try > + filename after I curl the webpage, it is under wd/. But is there a way for me to directly save it to my storage account? Thanks again for your patience! – physcis_beginner Nov 05 '18 at 22:38
  • I just know that you can create the task in the Azure portal with a Pool autouser, admin to execute the command `/bin/bash -c 'apt-get update && apt-get install parallel'`. I don't find the setting in CLI. And the persist output data, you can take a look at this [link](https://learn.microsoft.com/en-us/azure/batch/batch-task-output). – Charles Xu Nov 06 '18 at 03:17