Skip to main content

Prerequisites

Before installing the Agent Framework, ensure you have:
  • Python 3.10 or higher installed on your system
  • pip package manager (included with Python)
  • An Azure subscription (for Azure OpenAI integration)
The Agent Framework supports Windows, macOS, and Linux operating systems.

Install the Package

Install the Agent Framework using pip. We recommend two installation paths:
pip install agent-framework --pre
The --pre flag is required during the preview period to install pre-release versions.
Installing agent-framework gives you all sub-packages and integrations. This is the simplest way to get started. Use agent-framework-core for a minimal installation with only Azure OpenAI and OpenAI support.

Optional Packages

Install specific provider integrations as needed:
pip install agent-framework-azure-ai --pre

Set Up Authentication

The Agent Framework uses Azure CLI for authentication with Azure OpenAI services.
1

Install Azure CLI

If you haven’t already, install the Azure CLI.
2

Sign in to Azure

Authenticate with your Azure account:
az login
This command opens your browser to complete the sign-in process.
3

Set Your Subscription (Optional)

If you have multiple subscriptions, set the active one:
az account set --subscription "your-subscription-id"

Configure Environment Variables

Create a .env file in your project root to store configuration values:
.env
# Azure AI Foundry Project
AZURE_AI_PROJECT_ENDPOINT="https://your-project.api.azureml.ms"
AZURE_OPENAI_RESPONSES_DEPLOYMENT_NAME="gpt-4o"

# Azure OpenAI (alternative)
AZURE_OPENAI_ENDPOINT="https://your-resource.openai.azure.com"
AZURE_OPENAI_CHAT_DEPLOYMENT_NAME="gpt-4o"

# OpenAI (alternative)
OPENAI_API_KEY="sk-..."
OPENAI_CHAT_MODEL_ID="gpt-4o"
OPENAI_RESPONSES_MODEL_ID="gpt-4o"
You only need to configure the variables for the service you plan to use (Azure AI Foundry, Azure OpenAI, or OpenAI).

Install python-dotenv

To load environment variables from your .env file, install the python-dotenv package:
pip install python-dotenv
Then load the variables in your Python code:
from dotenv import load_dotenv

load_dotenv()
The python-dotenv package is automatically included as a dependency of agent-framework-core.

Verify Installation

Verify your installation by checking the package version:
pip show agent-framework-core
You should see output similar to:
Name: agent-framework-core
Version: 1.0.0rc3
Summary: Microsoft Agent Framework for building AI Agents with Python
Home-page: https://aka.ms/agent-framework
...

Next Steps

Quickstart

Create your first agent in minutes

First Agent

Build an agent with tools and function calling

Build docs developers (and LLMs) love