Files
93b03140c7 ยท 2026-04-20 18:39:56 -07:00
History
..
2026-04-20 18:37:24 -07:00
2026-04-20 18:39:56 -07:00
2026-04-20 18:11:32 -07:00

Foundry Hosted Agents Samples

This directory contains samples that demonstrate how to use the Agent Framework to host agents on Foundry with different capabilities and configurations. Each sample includes a README with instructions on how to set up, run, and interact with the agent.

Read more about Foundry Hosted Agents here.

Environment setup

  1. Navigate to the sample directory you want to run. For example:

    python -m venv .venv
    
    # Windows
    .venv\Scripts\Activate
    
    # macOS/Linux
    source .venv/bin/activate
    
  2. Install dependencies:

    pip install -r requirements.txt
    
  3. Create a .env file with your Foundry configuration following the env.example file in the sample.

  4. Make sure you are logged in with the Azure CLI:

    az login
    

Deploying to a Docker container

Navigate to the sample directory and build the Docker image:

docker build -t hosted-agent-sample .

Run the container, passing in the required environment variables:

docker run -p 8088:8088 \
  -e FOUNDRY_PROJECT_ENDPOINT=<your-endpoint> \
  -e MODEL_DEPLOYMENT_NAME=<your-model> \
  hosted-agent-sample

The server will be available at http://localhost:8088. You can send requests using the same curl command shown above.

Deploying to Foundry

Follow this guide to deploy your agent to Foundry.