AI-901: create and manage inference pipelines with Microsoft Foundry
I will explain how to design and manage an inference pipeline in Microsoft Foundry — a practical skill for AI-901 that appears in the Implement AI solutions with Microsoft Foundry section. Knowing how to assemble pipelines is essential to turn models (LLMs, vision, etc.) into reliable, scalable production services.
What you need to know
An inference pipeline is the sequence of steps that processes user input and returns model output. In Foundry, a pipeline joins modules (components) that do preprocessing, call the model, postprocessing, and business logic. The goal is to ensure the flow is repeatable, traceable, and adjustable without changing the underlying model.
Simple example: a text summarization application. A typical pipeline has: (1) receiving the text; (2) cleaning and truncation; (3) calling the LLM; (4) filtering/normalizing the result; (5) event logging and return. In Foundry, each step can be an independent component linked in an execution sequence.
How it works
Main concepts and responsibilities inside Foundry:
- Components: reusable processing units (can be code, connectors, or models).
- Pipelines: orchestrate components, defining order, parallelism, and inputs/outputs.
- Inference endpoints: exposed points for clients to call the pipeline as a service.
- Version management: control versions of components and pipelines for rollback and reproducibility.
- Observability: metrics, logs, and tracing to monitor latency, error rates, and costs.
In a pipeline you can also define retry policies, timeouts, and rate limiting to protect the service and control costs. Orchestration should anticipate failures in external components (e.g., model API) and have alternative paths or user-friendly error messages.
In practice
Here is a simplified step-by-step practical guide to create a text inference pipeline in Foundry. The concrete interfaces may vary, but the conceptual flow is applicable.
-
Define the requirement: for example, "summarize news articles in 3 sentences." Define inputs, outputs, and SLAs (acceptable latency).
-
Create components:
// Component: preprocess function preprocess(input) { // remove unwanted characters // truncate to N tokens to avoid excessive costs return cleanedText; } // Component: callModel async function callModel(cleanedText) { // call the LLM via Foundry SDK/endpoint // include parameters: temperature, max_tokens return modelResponse; } // Component: postprocess function postprocess(modelResponse) { // extract text, normalize spaces, ensure 3 sentences return summary; }Each component can be implemented as a script or container and registered in Foundry.
-
Orchestrate in the pipeline: connect preprocess → callModel → postprocess. Define timeouts and retries on the callModel component (e.g., 2 retries with exponential backoff).
-
Configure endpoint: define authentication, throttling, and per-user quotas. Publish an HTTP/REST endpoint that runs the pipeline.
-
Add observability: instrument each component to send metrics (latency, errors) and structured logs to OneLake/monitoring.
-
Test and validate: run unit tests on components and end-to-end tests with real inputs. Measure cost per call and adjust truncation/model parameterization.
-
Version management: whenever you change a component or model parameters, create a new pipeline version and keep the old one for rollback.
Common mistakes
- Ignoring token or cost limits: sending very long text to the model without truncation can trigger costs and quota errors. Define preprocessing that controls input size.
- Lack of observability: not instrumenting the pipeline prevents diagnosing latencies and failures; without metrics you don't know where to optimize.
- Tightly coupling business logic to the model: business decisions embedded in the prompt or model make iterations heavy. Keep transformation and validation outside the model when possible.
How to practice
Practice by creating several simple pipelines in Foundry's training environment or a sandbox: experiment with LLMs for generation, with vision models for classification, and with filtering components. To prepare for the exam, use Microsoft's official free Practice Assessment for AI-901 and the official study guide (both free). These resources help you confirm you master the concepts without using prohibited materials.
In summary
- Inference pipelines in Foundry chain components for preprocessing, calling the model, and postprocessing.
- Instrumentation, version management, and endpoint configuration are essential for reliable production.
- Input truncation, retries, and rate limits protect against high costs and failures.
- Practice with sandboxes and check Microsoft's official Practice Assessment and study guide — they are free and recommended.