New to Kestra?
Use blueprints to kickstart your first workflows.
Watch Azure AI Foundry evaluations for failures, alert Slack when one does not complete, and log the result for AI platform teams.
An AI Foundry evaluation run that fails or gets cancelled tells nobody on its own; the
studio shows the outcome if someone opens the run, and Azure AI Foundry does not keep a
schedule, decide which statuses count as a problem, or notify anyone the moment one comes
back anything but Completed. This blueprint watches every newly terminal evaluation and
pages the moment one does not succeed, with the real evaluation name attached.
This blueprint was created by Mohit Jeswani.
watch_evaluations (io.kestra.plugin.azure.aifoundry.Trigger) polls Azure AI
Foundry's evaluations API every 5 minutes and fires one execution per batch of
evaluations that newly reached Completed, Failed, Canceled, or Expired,
deduplicating already-observed evaluations via stateful tracking.evaluate (io.kestra.plugin.core.output.OutputValues) counts how many of this batch's
evaluations did not complete successfully and classifies the result: OK when all
succeeded, EVALUATION_FAILED for one or a few, WIDESPREAD_EVALUATION_FAILURE at or
above max_failed_in_batch.route (io.kestra.plugin.core.flow.If):summary logs the final counts and severity, closing the governance cycle.errors alerts Slack if the flow itself fails, for example an expired service principal
secret.aifoundry.Trigger used as
a standing evaluation-failure gate, distinct from this repo's existing Azure AI Foundry
blueprint, which audits a deployment's model configuration rather than reacting to
evaluation run outcomes.Azure AI Foundry reports an evaluation's status on request; it does not decide which
statuses mean trouble, compare a batch of failures against a tolerance you declare, or
notify a Slack channel the moment one appears. Kestra keeps max_failed_in_batch as a flow
input, turns a failed evaluation into a Slack page naming the real run, and keeps a full
execution history of every terminal evaluation ever observed.
This flow calls the Azure AI Foundry API directly over HTTPS; there is no official local
Azure AI Foundry emulator, so watch_evaluations cannot be exercised against a local Docker
container.
AZURE_AI_FOUNDRY_ENDPOINT: the project endpoint URL. In Kestra OSS, provide it as the
base64-encoded environment variable SECRET_AZURE_AI_FOUNDRY_ENDPOINT.AZURE_TENANT_ID / AZURE_CLIENT_ID / AZURE_CLIENT_SECRET: the Entra ID service
principal credentials used by watch_evaluations. In Kestra OSS, provide them as the
base64-encoded environment variables SECRET_AZURE_TENANT_ID, SECRET_AZURE_CLIENT_ID,
and SECRET_AZURE_CLIENT_SECRET.SLACK_WEBHOOK_URL: used by alert and the errors block. In Kestra OSS, provide it as
the base64-encoded environment variable SECRET_SLACK_WEBHOOK_URL.| Input | Default | Purpose |
|---|---|---|
max_failed_in_batch |
3 |
Failed-evaluation count per poll at or above which the batch is classified as widespread |
{{ trigger.evaluation }} / .evaluations / .total: the newly terminal evaluations
this poll found (each with name, status), as the Trigger reports them.{{ outputs.evaluate.values.failed_count }} / .failed_names / .total_evaluations: how
many evaluations failed, their names with statuses, and the total observed this poll.{{ outputs.evaluate.values.severity }}: OK, EVALUATION_FAILED, or
WIDESPREAD_EVALUATION_FAILURE.statuses on the trigger defaults to Completed, Failed, Canceled, and Expired;
an evaluation stuck in a non-terminal running state indefinitely never fires this trigger
at all, since it is not one of those four states.on mode and stateTtl.inputs: to override per execution; endpoint, credentials, and
interval are trigger-level configuration set directly on the trigger block.SLACK_WEBHOOK_URL.endpoint on watch_evaluations to a real AI Foundry project.compliant fires once it
completes successfully.alert fires as
EVALUATION_FAILED.WIDESPREAD_EVALUATION_FAILURE to an on-call paging channel and the isolated case to
a lower-urgency channel, since a batch failure usually points at an infrastructure issue
rather than one bad test case.interval for evaluation pipelines with a tight feedback-loop requirement, or raise
it for infrequent, long-running evaluation jobs.