Azure / azure-batch-cli-extensions

Batch extension cli commands for Azure cli v2
Other
12 stars 18 forks source link

Passing environment variables is not documented #138

Open fblampe opened 2 years ago

fblampe commented 2 years ago

The documentation sadly doesn't explain how to set environment variables for the containers that are created by az batch job create using e.g. a repeatTask.

By searching the Python code of the extension in this repo, I found out that environment variables can be configured as follows:

"repeatTask": {
    "commandLine": "env",
    "containerSettings": {
        "imageName": "alpine:latest"
    },
    "environmentSettings": [
        {
            "name": "VAR_1",
            "value": "someValue"
        },
        {
            "name": "VAR_2",
            "value": "anotherValue"
        }
    ]
}

It would be much easier to find out how to do this, if it was explained somewhere in the (otherwise quite detailed) docs in this repo. If it's not something specific to this extension, a link describing it would have already helped a lot, since web searches also didn't turn it up for me.