hands-on lab

Multi-Step AI Workflow with Azure Functions

Difficulty: Beginner
Duration: Up to 2 hours
Students: 3
Get guided in a real environmentPractice with a step-by-step scenario in a real, provisioned environment.
Learn and validateUse validations to check your solutions every step of the way.
See resultsTrack your knowledge and monitor your progress.

Description

Agentic-style systems go beyond basic chat—they may reason about a goal, choose which tools to call, and write their own "notes" so later steps have context. In Azure, you can assemble this pattern with Azure Functions for orchestration, Azure OpenAI for reasoning, and Azure Cosmos DB for memory and state. This lab walks you through building that end-to-end flow—entirely in the Azure portal—so you can see how a backend agentic workflow behaves in the wild: Reason → Act → Observe.

In this lab

In this hands-on lab, you'll create a JavaScript Azure Function that receives a customer complaint, uses Azure OpenAI (gpt-5-mini) to classify and summarize the complaint (with JSON-enforced output), and then writes a complete case document to Cosmos DB. You'll run the workflow entirely from the portal and review the persisted state—demonstrating how you can reliably chain LLM reasoning with actions and memory using a minimal footprint.

Learning objectives

Upon completion of this beginner-level lab, you will be able to:

  • Explain how agentic AI differs from traditional chatbot/LLM calls and how to realize Reason → Act → Observe in a single function.
  • Orchestrate a multi-step reasoning workflow inside an Azure Function.
  • Integrate Azure OpenAI from Functions to perform classification (JSON output) and summarization.
  • Persist and manage “memory” in Azure Cosmos DB.

Intended audience

  • Cloud Solution Architects
  • AI/ML Engineers and Developers
  • Technical Consultants exploring Azure AI
  • Innovation and R&D teams evaluating AI use cases

Prerequisites

Familiarity with the following will be beneficial but is not required:

  • Azure OpenAI
  • Azure Functions (HTTP trigger)
  • Azure Cosmos DB (Core/SQL)

The following content can be used to fulfill the prerequisites:

Environment before

Environment after

Covered topics

Hands-on Lab UUID

Lab steps

0 of 7 steps completed.Use arrow keys to navigate between steps. Press Enter to go to a step if available.
  1. Logging in to the Microsoft Azure Portal
  2. Reviewing CosmosDB and creating a Database
  3. Creating the Function App and setting up an Azure Function
  4. Building the Workflow with Azure Functions
  5. Setup an OpenAI model
  6. Set Environment Variables
  7. Executing the workflow