Files
agent-framework/python/samples/getting_started/azure_functions
T
Anirudh Garg 46df859b2a Python: Add README for Azure Functions samples setup (#2100)
* Add README for Azure Functions samples setup

Added setup instructions for Azure Functions samples, including environment setup, virtual environment creation, and running samples.

* Update python/samples/getting_started/azure_functions/README.md

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Apply suggestions from code review

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Apply suggestion from @Copilot

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Apply suggestions from code review

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Laveesh Rohra <larohra@microsoft.com>
46df859b2a · 2025-11-11 21:51:50 -08:00
History
..

These are common starting instructions for how to set up your environment for all the samples in this directory. These samples are for illustrating the use of the Durable extensibility to Agent Framework running in Azure Functions.

All of these samples are set up to run in Azure Functions. Azure Functions has a local development tool called CoreTools which we will set up to run these samples locally.

Environment Setup

1. Install dependencies and create appropriate services

2. Create and activate a virtual environment

Windows (PowerShell):

python -m venv .venv
.venv\Scripts\Activate.ps1

Linux/macOS:

python -m venv .venv
source .venv/bin/activate

3. Running the samples

  • Start the Azurite emulator

  • Inside each sample:

    • Install Python dependencies from this folder, run pip install -r requirements.txt (or the equivalent in your active virtual environment).

    • Copy local.settings.json.template to local.settings.json, then update AZURE_OPENAI_ENDPOINT, AZURE_OPENAI_CHAT_DEPLOYMENT_NAME, and AZURE_OPENAI_API_KEY so the Azure OpenAI SDK can authenticate; keep TASKHUB_NAME set to default unless you plan to change the durable task hub name.

  • Run the command func start from the root of the sample

  • Follow the specific instructions/requests for each sample