Verify the agent and register it in AMC
Prove the deployed agent with free probes first, run it once for real, then add token prices and register it in AMC.
probe.py calls the deployed endpoint as your signed-in az user. Run the probes in this order: each is cheaper than the next.
1. Preflight (free)
python probe.py preflightSends {"mode":"preflight"}: no model call, no skill. It must return envelope status ok before anything is spent. The detail starts with filesystem ok: N checks, which proves the host's file layer on this image (directories pin by descriptor, symlinks are refused, the scrub empties what it says), followed by one round trip per outbound dependency you added, as the agent's own identity.
2. Failed-run lifecycle (free)
python probe.py failedSends a request the shell refuses before spend (an unknown field) on both paths. On the stream it must end response.failed; the stored background response reads completed with envelope status failed.
3. A few minutes of streaming
python probe.py stream 300A real run for 300 seconds, printing each finished step with its model and tokens. Closing the connection cancels the turn, so this costs a small fraction of a full run. A cold container can take a minute or more to answer; the probe waits up to 180 s to connect.
4. The first full run
python probe.py backgroundStarts a background run, polls every 60 s (each GET also keeps the session alive), and prints the stored envelope. Once the agent is registered (step 6) you can start it from AMC instead. Then read the envelope:
statusisok.gate_evidencehas<gate>_oktrue for every gate.skills_bypassedisnull.step_tokens_attributedis at mostmodel_usagefor every model.- Then set the ceilings at 1.5× what you measured and deploy a new version with them.
5. Add token prices in AMC
Add a price for every model deployment name the agent can report, Haiku included when WebFetch is allowed. A missing price is billed at a generic default rate with no error. See Choose models and spend ceilings.
6. Register in AMC
Registration itself is covered in Register your agent. What is specific to a Foundry hosted agent:
| Field | Value for this agent |
|---|---|
| Kind | Agent |
| Adapter | Azure AI Foundry |
| Endpoint URL | The agent URL deploy.py printed: <your-foundry-project-endpoint>/agents/<agent-name>/endpoint/protocols/openai/responses. AMC derives the project endpoint (everything before /agents/) and the agent name from it, and adds api-version itself. |
| Auth | Managed Identity (same tenant) or API key |
| Resource scope | Leave blank for the default https://ai.azure.com/.default. The only other accepted value is https://cognitiveservices.azure.com/.default. |
- By default the endpoint host must be a Microsoft Foundry host (ending
.services.ai.azure.com,.ai.azure.comor.cognitiveservices.azure.com). AMC won't send its token anywhere else. - To register every agent in a project at once, use Import a Foundry project with the Foundry project endpoint. AMC lists the project's agents, registers each as an agent or workflow by its type, and never deactivates rows that are absent.
How AMC calls this agent
- AMC POSTs to the agent's Responses endpoint with
stream: true. A plain hosted agent is not sentbackgroundby default, so if AMC's connection drops, the turn is cancelled like any cut stream. - The Responses
inputis a string: AMC sends the run'spromptinput, or the first input if there is noprompt. The shell parses it as JSON, so a value such as{"target_date": "2026-10-16"}sets request fields, a bare value maps onto the primary field, and an empty value runs on every default. - A paused run (a
request_infoitem followed byresponse.completed) shows as waiting on a person. AMC sends the answer asfunction_call_outputwithprevious_response_id, as in Human-in-the-loop.
7. Schedule it
Schedule from AMC, which streams the run and shows a run that ends response.failed as failed. A raw scheduler sends {"input":"{}","background":true} and reads the envelope's status.
Related
Last updated 2026-10-21