AI Foundry Command Job

The AI Foundry Command Job job type submits an Azure Machine Learning Command job (run a script / binary on a compute target) in an Azure AI Foundry workspace. The template Command Job is identified by its job name — Polysync stores that in the External Id.

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

Required job fields

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

Optional job attributes (override template values per execution):

  • AI Foundry Compute Name — overrides properties.computeId.
  • AI Foundry Environment Name — overrides properties.environmentId.
  • AI Foundry Command — overrides properties.command.

Job discovery

GET /jobs?api-version=2024-10-01&$filter=jobType eq 'Command'&$top=100

Parameter handling

Identical to AI Foundry Pipeline Job — Input / Input&Output values land in inputs with { value, type: "literal" }, and on completion properties.outputs populates Output / Input&Output parameters.

Request body:

{
  "properties": {
    "jobType": "Command",
    "displayName": "<polysync-name>",
    "command": "<from-attr-or-template>",
    "computeId": "<from-attr-or-template>",
    "environmentId": "<from-attr-or-template>",
    "inputs": {
      "<name>": { "value": <typed-value>, "type": "literal" }
    }
  }
}

Execution flow

Identical to AI Foundry Pipeline Job:

  1. PUT /jobs/{newJobName} with the body above.
  2. Status polled via GET /jobs/{runId} with the same Azure ML status mapping table.
  3. Cancel via POST /jobs/{runId}/cancel.

Monitor URL

https://ml.azure.com/runs/{runId}
  ?wsid=/subscriptions/{subId}/resourceGroups/{rg}
   /providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}

Best practices

  • Reference the script's input names in the command string using ${{inputs.name}} — Azure ML interpolates Polysync values at run time.
  • Use the job-attribute overrides to swap compute / environment per Polysync Job without re-creating the template ML Job in Foundry.

Troubleshooting

  • ComputeNotFound — the override compute name does not exist in the workspace. Check the AI Foundry compute page.
  • EnvironmentNotFound — the override Environment is missing or not at the registered version. Use a fully-qualified azureml:env-name:version style.