- Lab
-
Libraries: If you want this lab, consider one of these libraries.
- Cloud
- Security
Completing the AI Pipeline
Bring the Smart Support Ticket pipeline online by adding its compute and AI layers to the storage and Cosmos DB resources you provisioned earlier. You'll create the Microsoft Foundry resource with a deployed gpt-5-mini model, provision the Azure Function App, wire up the environment variables that connect every service, deploy the Python function code, and watch the full pipeline run end to end as a ticket file uploaded to blob storage is classified by the model and persisted to Cosmos DB. By the end of this lab, you'll have a working AI pipeline you can trigger, monitor, and inspect.
Lab Info
Table of Contents
-
Challenge
Provision the Foundry resource and deploy a gpt-5-mini model to it
Create the Microsoft Foundry resource in the same region as your existing storage and Cosmos DB resources. Deploy the gpt-5-mini model and capture the endpoint and deployment name your function code will need.
Scenario: This is the AI layer of the pipeline. The endpoint and deployment name you create here will feed directly into the function app's environment variables in a later step.
-
Challenge
Provision the Azure Function App that will host the pipeline code
Create a Python Function App in the same region as the rest of the pipeline. Confirm the Function App's Application Insights instance is wired up for later observability.
Scenario: The Function App is the compute layer that connects blob storage to the model and Cosmos DB. You'll create the host first, then deploy code into it.
-
Challenge
Understand the function app code before deploying it
Walk through the blob trigger entry point, the Azure OpenAI client call, the Pydantic model that enforces the structured output shape, and the Cosmos DB upsert. Identify where each environment variable is read and how the values you just configured map to the code.
Scenario: With the resources provisioned and the environment variables in place, this is the moment to study the code that ties them together. The review sets up what you're about to deploy.
-
Challenge
Deploy the function app code from a local development environment
Optionally use the supplied virtual machine with Visual Studio Code preconfigured, or use your own local environment. Deploy the function code to the Function App and confirm the blob trigger registers successfully.
Scenario: You'll deploy the same code you just reviewed. The supplied VM exists for learners who'd rather not configure a local Python and Functions Core Tools setup.
-
Challenge
Configure the Function App's environment variables to connect every component of the pipeline
Supply the storage connection string, the Foundry endpoint and deployment name, the Cosmos DB connection details, and the Application Insights connection string. Confirm each value matches the resource it points to before deploying code.
Scenario: Every service the function talks to is referenced through an environment variable. Getting these right is what turns a collection of resources into a working pipeline.
-
Challenge
Run the pipeline end to end and trace a ticket through every stage
Upload a sample email text file to the inbound blob container. Watch the function execute in real time using the Function App's log stream, then review the invocation history. Use Application Insights to inspect the end-to-end trace for the run. Open the Cosmos DB container and confirm the structured document the model produced has landed correctly.
Scenario: This is the payoff. A single file upload triggers the full pipeline, and you'll follow it through every layer—function logs, Application Insights, and finally the document that lands in Cosmos DB.
About the author
Real skill practice before real-world application
Hands-on Labs are real environments created by industry experts to help you learn. These environments help you gain knowledge and experience, practice without compromising your system, test without risk, destroy without fear, and let you learn from your mistakes. Hands-on Labs: practice your skills before delivering in the real world.
Learn by doing
Engage hands-on with the tools and technologies you’re learning. You pick the skill, we provide the credentials and environment.
Follow your guide
All labs have detailed instructions and objectives, guiding you through the learning process and ensuring you understand every step.
Turn time into mastery
On average, you retain 75% more of your learning if you take time to practice. Hands-on labs set you up for success to make those skills stick.