Lesson 3 of 3 Building Generative Applications with Foundry

Integrating Foundry into Applications with SDKs and Connectors

This lesson explains the SDKs and connectors that integrate Foundry with applications and data, and the patterns for embedding generative steps in business software.

Learning outcomes

After completing this lesson, you will be able to:

  • Identify the Python packages that AI-103 solutions commonly use.
  • Describe the connectors that link Foundry to data and systems.
  • Choose an integration pattern for a generative step.

SDKs

AI-103 solutions are built from several Python packages, and knowing which package does what helps when reading code in exam questions. Three packages appear in almost every solution. azure-identity supplies DefaultAzureCredential for keyless authentication. azure-ai-projects is the Foundry SDK: it connects to a project and manages agents, connections, deployments, evaluations and telemetry, and it returns an authenticated OpenAI client. openai is the library that client comes from, and it provides the model APIs themselves: Responses, Chat Completions, embeddings, images, video and audio.

Other packages are added for specific capabilities. azure-search-documents manages and queries Azure AI Search; azure-ai-evaluation runs evaluators; the Speech SDK handles recognition, synthesis and speech translation; azure-monitor-opentelemetry exports traces to Application Insights; and the Microsoft Agent Framework builds agents and multi-agent workflows in code. Foundry Tools without a dedicated SDK in the solution, such as Translator or Content Understanding, are often called through their REST APIs with a bearer token from azure-identity. The following table summarizes the packages.

PackagePurpose
azure-ai-projectsFoundry projects: agents, connections, deployments, evaluations, telemetry; OpenAI client
openaiResponses, Chat Completions, embeddings, images, videos and audio on the v1 API
azure-identityDefaultAzureCredential and token providers for keyless authentication
azure-ai-evaluationQuality, agent and safety evaluators and the evaluate() function
azure-search-documentsAzure AI Search indexes, indexers, skillsets and queries
azure-ai-textanalytics / Language RESTAzure Language analysis
azure-cognitiveservices-speechAzure Speech SDK for recognition, synthesis and translation
azure-monitor-opentelemetryExport OpenTelemetry traces to Application Insights
agent-frameworkMicrosoft Agent Framework for agents and multi-agent workflows in code

Connectors

Connectors link Foundry to data and systems without custom integration code. Project connections link the project to Azure AI Search, Storage, Application Insights, Bing and other services. Agent tools connect agents to SharePoint, Microsoft Fabric data agents, OpenAPI services and MCP servers. Azure Logic Apps provides hundreds of connectors to SaaS and enterprise systems, such as Dynamics 365, Salesforce and ServiceNow, and a Logic App workflow can be exposed to an agent as a tool.

Integration patterns

Generative steps are embedded in applications in a few ways. The application's API calls the model or agent synchronously for interactive features and streams the result. Event-driven processing uses Azure Functions triggered by Blob Storage, Service Bus or Event Grid events, for example to summarize each new document. Long-running work, such as video generation or large document translation, is submitted asynchronously and its result stored for later. Published agents are called by other applications through their endpoint, and the Microsoft 365 Agents SDK can bring them into Microsoft Teams and Microsoft 365 Copilot.

Sort into groups

Choose the integration pattern

Exam skills 2.1.5

Choose how a generative step is embedded in each application.

Log in to try this activity Interactive activities are free with an account.
Worked example

Adding generative summaries to a workflow

When a contract PDF is uploaded to Blob Storage, a company wants a summary and key dates stored in its contract management system within minutes, with the least custom infrastructure.

An Azure Function with a Blob Storage trigger (or Event Grid event) calls Content Understanding to convert the PDF to Markdown with date fields, calls a model with structured outputs for the summary, and writes the result through the system's API, all with the function's managed identity. A polling virtual machine would work but adds infrastructure to maintain.

Check yourself

Which packages handle Foundry resources, model calls and credentials?

Show answer

azure-ai-projects for Foundry resources, openai for the model APIs, and azure-identity for credentials.

Exam Tips

Remember for the exam

  • azure-ai-projects for Foundry resources; openai for model APIs; azure-identity for credentials.
  • Business systems without custom code: Logic Apps connectors exposed as tools.
  • React to new content with event-driven Azure Functions.