Azure Batch and API Job ADD: upload file in wd directory with

244 Views Asked by At

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!

1

There are 1 best solutions below

2
fpark On

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).