0

I'm using API Job Add to create one Job with one Task in Azure Batch.

This is my test code:

{
    "id": "20211029-1540",
    "priority": 0,
    "poolInfo": {
        "poolId": "pool-test"
    },
    "jobManagerTask": {
        "id": "task2",
        "commandLine": "cmd /c dir",
        "resourceFiles": [
            {
                "storageContainerUrl": "https://linkToMyStorage/MyProject/StartTask.txt"
            }
        ]
    }
}

To execute the API I'm using Postman and to monitor the result I'm using BatchExplorer.

The job and it's task are created correctly, but the 'wd' folder generate automatically is empty. If I understood fine, I should see the linked file in the storage variable, right? enter image description here

enter image description here

Maybe, some other parameter is needed in the Json of the body?

Thank you!

Robertino
  • 34
  • 5

1 Answers1

1

Task state of completed does not necessarily indicate success. From your json body, you most likely have an error:

        "resourceFiles": [
            {
                "storageContainerUrl": "https://linkToMyStorage/MyProject/StartTask.txt"
            }

You've specified a storageContainerUrl with a file. Also ensure you have provided proper permissions (either via SAS or a user managed identity).

fpark
  • 2,304
  • 2
  • 14
  • 21
  • Of course, the link posted is only an example. So, I don't see any file in wd folder because I don't have the grant? Without grant I receive this error: "One of the specified Azure Blob container(s) is not found", than I think that the grant are correct, but I don't know if other grant are required. – Robertino Nov 29 '21 at 22:43
  • You will need to ensure that the URI provided has the proper SAS as required for access or provided via Managed Identity. If you are getting a "not found" error, then you may want to double check that your link is valid and the storage account/container exists. – fpark Dec 07 '21 at 16:34