AI Foundry Command Job

The AI Foundry Command Job job type re-runs an Azure Machine Learning Command job (a script or binary on a compute target) in an Azure AI Foundry hub / Azure ML workspace. Azure ML has no separate job definitions: the job you import is a template run, identified by its job name (stored in External Id). Every Polysync execution submits a clone of it — same code snapshot, environment, compute, resources, distribution, limits and experiment — with the task's input values overlaid.

This job type is supported on the Azure AI Foundry platform.

Required job fields

  • External Id — the template job's name (set on import).
  • Job Type — AI Foundry Command Job (set automatically on import).

Optional job settings — imported from the template, and sent only as overrides:

  • Compute Name — replaces properties.computeId (a compute name; Polysync expands it to the workspace compute's ARM id). Empty on templates that run on serverless compute.
  • Environment Name — replaces properties.environmentId. Keep the full id.
  • Command — replaces properties.command.

Job discovery

GET /jobs?api-version=2026-07-01&jobType=Command     (every nextLink page is followed)

Each template's MLflow run is read once to declare what it produces. Runs Polysync submitted are tagged polysync_template and never listed.

Parameter handling

Source on import Polysync parameter Direction
inputs.<name> (literal) <name>, default = the template's value Input
inputs.<name> (data: uri_file, uri_folder, mltable, …) <name>, default = the template's URI Input
outputs.<name> (data output) <name> Output
MLflow metrics and tags the template run logged <key> Output

On execution, every Input / Input & Output parameter with a value is sent: a literal input as { "jobInputType": "literal", "value": "<text>" }, and a data input keeps its type and mode with its uri replaced. An empty value keeps the template's own value. Output parameters and the job settings above are never sent as inputs.

{
  "properties": {
    "...": "(everything from the template, minus status/services/properties)",
    "displayName": "<job name>-<yyyyMMddHHmmss>",
    "computeId": "/subscriptions/…/workspaces/<ws>/computes/<Compute Name>",
    "inputs": {
      "<name>": { "jobInputType": "literal", "value": "<text>" }
    },
    "tags": { "polysync_template": "<template name>" }
  }
}

Reference inputs in the command with ${{inputs.<name>}}; Azure ML substitutes the values.

Execution flow

  1. GET /jobs/{externalId}: the template. If it is missing (deleted or archived), the run fails with an instructive message and nothing is submitted.

  2. PUT /jobs/polysync-{guid} with the clone above. The new name becomes the Polysync RunId. Azure ML errors such as UserError: … are surfaced verbatim.

  3. Status is polled with GET /jobs/{runId}:

    Azure ML status Polysync status
    NotStarted, Starting, Provisioning, Preparing, Queued, Running, Finalizing, NotResponding, Paused Running
    Completed Success
    Failed Failed
    Canceled, CancelRequested Cancelled
    (other) Unknown
  4. When the run ends, start and end times and the failure message come from the workspace's run-history API. A failed run reports for example UserError: Execution failed. User process 'python' exited with status code 2.

  5. On success, output read-back fills Output / Input & Output parameters from:

    • the run's MLflow metrics (latest value) and user tags, for example mlflow.set_tag("echo", …) or mlflow.log_metric("score", …);
    • the uri of any data output with an explicit path. Azure ML reports no URI for default-path outputs.

    Everything else the run logged is returned as well, so it shows in the run record without a re-import.

  6. Cancel: POST /jobs/{runId}/cancel.

Monitor URL

https://ml.azure.com/runs/{runId}?wsid=/subscriptions/{subId}/resourcegroups/{rg}/workspaces/{workspaceName}

(the run's own Studio link when Azure ML returns one).

Best practices

  • Import a template run that completed successfully, so the declared outputs match what the script logs.
  • Log anything a downstream task needs with MLflow, using a tag for text and a metric for numbers. Name it the way you want the Polysync output parameter to be named.
  • Leave the job settings as imported unless you deliberately want a different compute or environment for this Polysync job.

Troubleshooting

  • Template job '…' was not found — the template run was deleted or archived. Re-import a current run.
  • UserError: … compute … — the override Compute Name does not exist in the workspace.
  • An Output parameter stays empty — the run did not log that MLflow key, or the data output has no explicit path.