├── samples-mistral ├── .gitkeep ├── python │ └── 0000950170-25-100226.pdf ├── pyproject.toml └── README.md ├── samples-classic ├── data │ └── .gitkeep ├── python │ ├── quickstart │ │ ├── requirements.txt │ │ └── README.md │ └── getting-started-agents │ │ ├── 3p-tools │ │ ├── legalfly │ │ │ └── .env.example │ │ ├── MiHCM │ │ │ ├── requirements.txt │ │ │ └── ArchitectureOverview.png │ │ ├── Celonis │ │ │ └── media │ │ │ │ ├── copy.png │ │ │ │ ├── actions.png │ │ │ │ ├── publish.png │ │ │ │ ├── add_action.png │ │ │ │ ├── connection.png │ │ │ │ ├── new_asset_menu.png │ │ │ │ ├── create_copilot_menu.png │ │ │ │ └── create_custom_tool.png │ │ ├── Morningstar │ │ │ └── media │ │ │ │ ├── custom-keys.png │ │ │ │ ├── project-assets.png │ │ │ │ ├── connected-resources.png │ │ │ │ └── connect-custom-resource.png │ │ ├── Tripadvisor │ │ │ └── media │ │ │ │ ├── custom-keys.png │ │ │ │ ├── add-connection.png │ │ │ │ ├── add-data-source.png │ │ │ │ ├── project-assets.png │ │ │ │ ├── connected-resources.png │ │ │ │ └── connect-custom-resource.png │ │ └── Trademo_Global_trade │ │ │ └── custom_connection.png │ │ ├── requirements.txt │ │ ├── agent-framework │ │ ├── agents_in_workflow │ │ │ ├── requirements.txt │ │ │ ├── Dockerfile │ │ │ └── agent.yaml │ │ ├── agent_with_hosted_mcp │ │ │ ├── requirements.txt │ │ │ ├── Dockerfile │ │ │ ├── main.py │ │ │ └── agent.yaml │ │ └── agent_with_text_search_rag │ │ │ ├── requirements.txt │ │ │ ├── Dockerfile │ │ │ └── agent.yaml │ │ ├── hosted-agents │ │ ├── hugging-face-tool-agent │ │ │ ├── requirements.txt │ │ │ ├── Dockerfile │ │ │ └── agent.yaml │ │ ├── calculator-agent │ │ │ ├── requirements.txt │ │ │ ├── Dockerfile │ │ │ └── agent.yaml │ │ ├── echo-agent │ │ │ ├── requirements.txt │ │ │ ├── Dockerfile │ │ │ └── agent.yaml │ │ ├── msft-docs-agent │ │ │ ├── requirements.txt │ │ │ ├── Dockerfile │ │ │ └── agent.yaml │ │ └── web-search-agent │ │ │ ├── requirements.txt │ │ │ ├── Dockerfile │ │ │ └── agent.yaml │ │ └── openapi │ │ └── countries.json ├── javascript │ └── quickstart │ │ ├── .env.template │ │ ├── package.json │ │ └── README.md ├── typescript │ └── quickstart │ │ ├── .env.template │ │ ├── tsconfig.json │ │ ├── package.json │ │ └── README.md └── csharp │ ├── quickstart │ ├── Samples │ │ ├── .env.example │ │ └── SimpleInference.cs │ └── README.md │ └── getting-started-agents │ └── AgentFramework │ ├── AgentsInWorkflows │ ├── Dockerfile │ ├── run-requests.http │ ├── AgentsInWorkflows.csproj │ └── agent.yaml │ ├── AgentWithHostedMCP │ ├── Dockerfile │ ├── run-requests.http │ ├── AgentWithHostedMCP.csproj │ └── agent.yaml │ └── AgentWithTextSearchRag │ ├── Dockerfile │ ├── run-requests.http │ ├── AgentWithTextSearchRag.csproj │ └── agent.yaml ├── infrastructure ├── infrastructure-setup-terraform │ ├── 00-basic │ │ └── code │ │ │ ├── data.tf │ │ │ ├── outputs.tf │ │ │ ├── example.tfvars │ │ │ ├── providers.tf │ │ │ ├── variables.tf │ │ │ └── versions.tf │ ├── 00-basic-azurerm │ │ └── code │ │ │ ├── outputs.tf │ │ │ ├── data.tf │ │ │ ├── example.tfvars │ │ │ ├── providers.tf │ │ │ ├── variables.tf │ │ │ └── versions.tf │ ├── 15a-private-network-standard-agent-setup │ │ └── code │ │ │ ├── outputs.tf │ │ │ ├── data.tf │ │ │ ├── providers.tf │ │ │ ├── example.tfvars │ │ │ ├── locals.tf │ │ │ ├── versions.tf │ │ │ └── variables.tf │ └── 15b-private-network-standard-agent-setup-byovnet │ │ └── code │ │ ├── data.tf │ │ ├── outputs.tf │ │ ├── locals.tf │ │ ├── versions.tf │ │ ├── example.tfvars │ │ ├── providers.tf │ │ └── variables.tf └── infrastructure-setup-bicep │ ├── 42-basic-agent-setup-with-customization │ ├── azurebyo.PNG │ └── main.parameters.json │ ├── 01-connections │ ├── README.md │ ├── deployment.parameters.json │ ├── model-gateway │ │ └── samples │ │ │ ├── parameters-openai.json │ │ │ └── parameters-dynamic.json │ └── apim │ │ └── samples │ │ └── parameters-dynamic-discovery.json │ ├── 20-user-assigned-identity │ ├── metadata.json │ └── README.md │ ├── 18-managed-virtual-network-preview │ ├── modules-network-secured │ │ ├── subnet.bicep │ │ ├── format-project-workspace-id.bicep │ │ ├── azure-storage-account-role-assignment.bicep │ │ ├── cosmosdb-account-role-assignment.bicep │ │ ├── add-project-capability-host.bicep │ │ └── cosmos-container-role-assignments.bicep │ ├── metadata.json │ └── update-outbound-rules-cli │ │ ├── outbound-rule-cdb.json │ │ ├── outbound-rule-storage.json │ │ └── outbound-rule-search.json │ ├── 15-private-network-standard-agent-setup │ ├── metadata.json │ ├── modules-network-secured │ │ ├── format-project-workspace-id.bicep │ │ ├── subnet.bicep │ │ ├── azure-storage-account-role-assignment.bicep │ │ ├── cosmosdb-account-role-assignment.bicep │ │ ├── add-project-capability-host.bicep │ │ └── cosmos-container-role-assignments.bicep │ └── add-project.bicepparam │ ├── 16-private-network-standard-agent-apim-setup-preview │ ├── metadata.json │ └── modules-network-secured │ │ ├── format-project-workspace-id.bicep │ │ ├── subnet.bicep │ │ ├── azure-storage-account-role-assignment.bicep │ │ ├── cosmosdb-account-role-assignment.bicep │ │ ├── add-project-capability-host.bicep │ │ └── cosmos-container-role-assignments.bicep │ ├── 41-standard-agent-setup │ ├── modules-standard │ │ ├── format-project-workspace-id.bicep │ │ ├── azure-storage-account-role-assignment.bicep │ │ ├── cosmosdb-account-role-assignment.bicep │ │ └── cosmos-container-role-assignments.bicep │ └── azuredeploy.parameters.json │ ├── 17-private-network-standard-user-assigned-identity-agent-setup │ ├── metadata.json │ └── modules-network-secured │ │ ├── format-project-workspace-id.bicep │ │ ├── subnet.bicep │ │ ├── azure-storage-account-role-assignment.bicep │ │ ├── cosmosdb-account-role-assignment.bicep │ │ ├── add-project-capability-host.bicep │ │ └── cosmos-container-role-assignments.bicep │ ├── 43-standard-agent-setup-with-customization │ ├── modules-standard │ │ ├── format-project-workspace-id.bicep │ │ ├── ai-account-identity.bicep │ │ ├── azure-storage-account-role-assignment.bicep │ │ ├── cosmosdb-account-role-assignment.bicep │ │ └── cosmos-container-role-assignments.bicep │ └── azuredeploy.parameters.json │ ├── 30-customer-managed-keys │ └── deployment.parameters.json │ ├── 10-private-network-basic │ └── README.md │ ├── 40-basic-agent-setup │ └── basic-setup.parameters.json │ ├── 00-basic │ ├── metadata.json │ └── README.md │ ├── 25-entraid-passthrough │ └── README.md │ ├── 45-basic-agent-bing │ ├── README.md │ └── modules │ │ ├── ai-project-keys.bicep │ │ └── add-bing-search-tool.bicep │ ├── 32-customer-managed-keys-user-assigned-identity │ └── deployment.parameters.json │ ├── 05-custom-policy-definitions │ └── deny-non-foundry-resource-kinds.json │ ├── 02-storage-speech-language │ ├── modules │ │ ├── roleAssignment.bicep │ │ └── storageAccount.bicep │ └── README.md │ └── 31-customer-managed-keys-standard-agent │ ├── deployment.parameters.json │ └── modules-standard │ ├── azure-storage-account-role-assignment.bicep │ ├── cosmosdb-account-role-assignment.bicep │ └── cosmos-container-role-assignments.bicep ├── .infra ├── pytest_plugins │ └── changed_samples │ │ ├── src │ │ ├── pytest_changed_samples │ │ │ └── __init__.py │ │ └── pytest_changed_samples.egg-info │ │ │ ├── dependency_links.txt │ │ │ ├── top_level.txt │ │ │ ├── requires.txt │ │ │ ├── entry_points.txt │ │ │ ├── SOURCES.txt │ │ │ └── PKG-INFO │ │ ├── build │ │ └── lib │ │ │ └── pytest_changed_samples │ │ │ └── __init__.py │ │ ├── README.md │ │ └── pyproject.toml └── deployment │ └── modules │ ├── container_registry.bicep │ ├── keyvault.bicep │ ├── role_assignment.bicep │ ├── ai_project.bicep │ ├── storageAccount.bicep │ └── ai_project_deployment.bicep ├── samples ├── python │ ├── hosted-agents │ │ ├── code-interpreter-custom │ │ │ ├── .gitignore │ │ │ ├── .env.sample │ │ │ ├── pyproject.toml │ │ │ └── requirements.txt │ │ ├── agents_in_workflow │ │ │ ├── requirements.txt │ │ │ ├── Dockerfile │ │ │ └── agent.yaml │ │ ├── agent_with_hosted_mcp │ │ │ ├── requirements.txt │ │ │ ├── Dockerfile │ │ │ ├── agent.yaml │ │ │ └── main.py │ │ ├── agent_with_text_search_rag │ │ │ ├── requirements.txt │ │ │ ├── Dockerfile │ │ │ └── agent.yaml │ │ ├── calculator-agent │ │ │ ├── requirements.txt │ │ │ ├── Dockerfile │ │ │ ├── README.md │ │ │ └── agent.yaml │ │ ├── echo-agent │ │ │ ├── requirements.txt │ │ │ ├── Dockerfile │ │ │ ├── README.md │ │ │ └── agent.yaml │ │ └── web-search-agent │ │ │ ├── requirements.txt │ │ │ ├── Dockerfile │ │ │ ├── README.md │ │ │ └── agent.yaml │ ├── enterprise-agent-tutorial │ │ └── 1-idea-to-prototype │ │ │ ├── .gitkeep │ │ │ ├── requirements.txt │ │ │ └── sharepoint-sample-data │ │ │ ├── remote-work-policy.docx │ │ │ ├── security-guidelines.docx │ │ │ ├── collaboration-standards.docx │ │ │ └── data-governance-policy.docx │ └── quickstart │ │ ├── requirements.txt │ │ ├── .env-template │ │ ├── quickstart-responses.py │ │ ├── quickstart-create-agent.py │ │ └── quickstart-chat-with-agent.py ├── csharp │ ├── quickstart │ │ ├── .env-template │ │ ├── nuget.config │ │ ├── quickstart-responses.cs │ │ └── quickstart-create-agent.cs │ ├── FoundryA365 │ │ ├── src │ │ │ └── hello_world_a365_agent │ │ │ │ ├── wwwroot │ │ │ │ └── favicon.png │ │ │ │ ├── ToolingManifest.json │ │ │ │ ├── global.json │ │ │ │ ├── appsettings.Development.json │ │ │ │ ├── AgentLogic │ │ │ │ ├── AgentConfiguration.cs │ │ │ │ └── AgentInstructions.cs │ │ │ │ ├── foundry-infra │ │ │ │ └── Dockerfile │ │ │ │ ├── Models │ │ │ │ └── PresenceState.cs │ │ │ │ └── Properties │ │ │ │ └── launchSettings.json │ │ ├── azure.yaml │ │ ├── .gitignore │ │ ├── infra │ │ │ └── modules │ │ │ │ ├── botservice.bicep │ │ │ │ └── application.bicep │ │ └── scripts │ │ │ └── post-provision.ps1 │ ├── enterprise-agent-tutorial │ │ └── 1-idea-to-prototype │ │ │ ├── Evaluate │ │ │ ├── nuget.config │ │ │ └── Evaluate.csproj │ │ │ └── ModernWorkplaceAssistant │ │ │ ├── nuget.config │ │ │ └── ModernWorkplaceAssistant.csproj │ └── hosted-agents │ │ ├── AgentWithHostedMCP │ │ ├── Dockerfile │ │ ├── run-requests.http │ │ ├── AgentWithHostedMCP.csproj │ │ └── agent.yaml │ │ ├── AgentsInWorkflows │ │ ├── Dockerfile │ │ ├── run-requests.http │ │ ├── AgentsInWorkflows.csproj │ │ └── agent.yaml │ │ └── AgentWithTextSearchRag │ │ ├── Dockerfile │ │ ├── run-requests.http │ │ ├── AgentWithTextSearchRag.csproj │ │ └── agent.yaml ├── typescript │ ├── quickstart │ │ ├── .env-template │ │ └── src │ │ │ ├── quickstart-responses.ts │ │ │ ├── quickstart-create-agent.ts │ │ │ └── quickstart-chat-with-agent.ts │ └── enterprise-agent-tutorial │ │ └── 1-idea-to-prototype │ │ ├── .gitignore │ │ ├── .env.template │ │ ├── tsconfig.json │ │ └── package.json ├── REST │ └── quickstart │ │ ├── quickstart-responses.sh │ │ ├── quickstart-create-agent.sh │ │ └── quickstart-chat-with-agent.sh └── java │ ├── enterprise-agent-tutorial │ └── 1-idea-to-prototype │ │ └── .gitignore │ └── quickstart │ └── src │ └── main │ └── java │ └── com │ └── microsoft │ └── foundry │ └── samples │ └── CreateAgent.java ├── dev-requirements.txt ├── migration ├── .dockerignore └── requirements.txt ├── CODE_OF_CONDUCT.md ├── .github ├── workflows │ ├── pre-commit.yml │ └── pull-request-checks.yml └── copilot-instructions.md ├── tox.ini ├── README.md ├── LICENSE └── SUPPORT.md /samples-mistral/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /samples-classic/data/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /infrastructure/infrastructure-setup-terraform/00-basic/code/data.tf: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /infrastructure/infrastructure-setup-terraform/00-basic/code/outputs.tf: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /.infra/pytest_plugins/changed_samples/src/pytest_changed_samples/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /infrastructure/infrastructure-setup-terraform/00-basic-azurerm/code/outputs.tf: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /.infra/pytest_plugins/changed_samples/build/lib/pytest_changed_samples/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /infrastructure/infrastructure-setup-terraform/00-basic-azurerm/code/data.tf: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /.infra/pytest_plugins/changed_samples/README.md: -------------------------------------------------------------------------------- 1 | # pytest-changed-samples 2 | 3 | 4 | -------------------------------------------------------------------------------- /infrastructure/infrastructure-setup-terraform/00-basic/code/example.tfvars: -------------------------------------------------------------------------------- 1 | location = "eastus" 2 | -------------------------------------------------------------------------------- /samples-classic/python/quickstart/requirements.txt: -------------------------------------------------------------------------------- 1 | azure-ai-projects 2 | openai 3 | azure-identity -------------------------------------------------------------------------------- /.infra/pytest_plugins/changed_samples/src/pytest_changed_samples.egg-info/dependency_links.txt: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /infrastructure/infrastructure-setup-terraform/15a-private-network-standard-agent-setup/code/outputs.tf: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /samples/python/hosted-agents/code-interpreter-custom/.gitignore: -------------------------------------------------------------------------------- 1 | .venv/ 2 | .env 3 | __pycache__/ 4 | -------------------------------------------------------------------------------- /infrastructure/infrastructure-setup-terraform/00-basic-azurerm/code/example.tfvars: -------------------------------------------------------------------------------- 1 | location = "eastus" 2 | -------------------------------------------------------------------------------- /infrastructure/infrastructure-setup-terraform/15a-private-network-standard-agent-setup/code/data.tf: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /infrastructure/infrastructure-setup-terraform/15b-private-network-standard-agent-setup-byovnet/code/data.tf: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /infrastructure/infrastructure-setup-terraform/15b-private-network-standard-agent-setup-byovnet/code/outputs.tf: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /.infra/pytest_plugins/changed_samples/src/pytest_changed_samples.egg-info/top_level.txt: -------------------------------------------------------------------------------- 1 | pytest_changed_samples 2 | -------------------------------------------------------------------------------- /samples/python/enterprise-agent-tutorial/1-idea-to-prototype/.gitkeep: -------------------------------------------------------------------------------- 1 | # This file ensures the directory is created 2 | -------------------------------------------------------------------------------- /.infra/pytest_plugins/changed_samples/src/pytest_changed_samples.egg-info/requires.txt: -------------------------------------------------------------------------------- 1 | gitpython~=3.0 2 | pytest>=7.0.0 3 | -------------------------------------------------------------------------------- /samples/python/hosted-agents/agents_in_workflow/requirements.txt: -------------------------------------------------------------------------------- 1 | azure-ai-agentserver-agentframework==1.0.0b7 2 | agent-framework -------------------------------------------------------------------------------- /samples/python/quickstart/requirements.txt: -------------------------------------------------------------------------------- 1 | azure-ai-projects>=2.0.0a20250915020 2 | azure-identity 3 | python-dotenv 4 | openai -------------------------------------------------------------------------------- /samples/python/hosted-agents/agent_with_hosted_mcp/requirements.txt: -------------------------------------------------------------------------------- 1 | azure-ai-agentserver-agentframework==1.0.0b7 2 | agent-framework -------------------------------------------------------------------------------- /samples/python/hosted-agents/agent_with_text_search_rag/requirements.txt: -------------------------------------------------------------------------------- 1 | azure-ai-agentserver-agentframework==1.0.0b7 2 | agent-framework -------------------------------------------------------------------------------- /samples-classic/python/getting-started-agents/3p-tools/legalfly/.env.example: -------------------------------------------------------------------------------- 1 | PROJECT_ENDPOINT= 2 | MODEL= 3 | LEGALFLY_API_CONNECTION_NAME= 4 | -------------------------------------------------------------------------------- /samples-classic/python/getting-started-agents/requirements.txt: -------------------------------------------------------------------------------- 1 | pytest 2 | openai 3 | azure-ai-projects 4 | azure-ai-agents 5 | azure-identity -------------------------------------------------------------------------------- /.infra/pytest_plugins/changed_samples/src/pytest_changed_samples.egg-info/entry_points.txt: -------------------------------------------------------------------------------- 1 | [pytest11] 2 | changed_samples = pytest_changed_samples.plugin 3 | -------------------------------------------------------------------------------- /samples/python/hosted-agents/code-interpreter-custom/.env.sample: -------------------------------------------------------------------------------- 1 | AZURE_AI_PROJECT_ENDPOINT= 2 | AZURE_AI_CONNECTION_ID= 3 | AZURE_AI_MODEL_DEPLOYMENT_NAME= -------------------------------------------------------------------------------- /infrastructure/infrastructure-setup-terraform/00-basic/code/providers.tf: -------------------------------------------------------------------------------- 1 | # Setup providers 2 | provider "azapi" { 3 | subscription_id = var.subscription_id 4 | } -------------------------------------------------------------------------------- /samples-classic/python/getting-started-agents/agent-framework/agents_in_workflow/requirements.txt: -------------------------------------------------------------------------------- 1 | azure-ai-agentserver-agentframework==1.0.0b3 2 | agent-framework -------------------------------------------------------------------------------- /samples-mistral/python/0000950170-25-100226.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/azure-ai-foundry/foundry-samples/HEAD/samples-mistral/python/0000950170-25-100226.pdf -------------------------------------------------------------------------------- /samples/csharp/quickstart/.env-template: -------------------------------------------------------------------------------- 1 | AZURE_AI_PROJECT_ENDPOINT= 2 | AZURE_AI_FOUNDRY_AGENT_NAME=MyAgent 3 | AZURE_AI_FOUNDRY_MODEL_DEPLOYMENT_NAME=gpt-4.1-mini -------------------------------------------------------------------------------- /samples-classic/python/getting-started-agents/agent-framework/agent_with_hosted_mcp/requirements.txt: -------------------------------------------------------------------------------- 1 | azure-ai-agentserver-agentframework==1.0.0b3 2 | agent-framework -------------------------------------------------------------------------------- /samples/typescript/quickstart/.env-template: -------------------------------------------------------------------------------- 1 | AZURE_AI_PROJECT_ENDPOINT= 2 | AZURE_AI_FOUNDRY_AGENT_NAME=MyAgent 3 | AZURE_AI_FOUNDRY_MODEL_DEPLOYMENT_NAME=gpt-4.1-mini -------------------------------------------------------------------------------- /samples-classic/python/getting-started-agents/agent-framework/agent_with_text_search_rag/requirements.txt: -------------------------------------------------------------------------------- 1 | azure-ai-agentserver-agentframework==1.0.0b3 2 | agent-framework -------------------------------------------------------------------------------- /samples/python/enterprise-agent-tutorial/1-idea-to-prototype/requirements.txt: -------------------------------------------------------------------------------- 1 | azure-ai-projects>=2.0.0a20251015001 2 | azure-ai-agents>=2.0.0a20251015001 3 | azure-identity 4 | python-dotenv -------------------------------------------------------------------------------- /samples/python/hosted-agents/calculator-agent/requirements.txt: -------------------------------------------------------------------------------- 1 | azure-ai-agentserver-langgraph==1.0.0b7 2 | 3 | pytest==8.4.2 4 | python-dotenv==1.1.1 5 | azure-monitor-opentelemetry==1.8.1 6 | -------------------------------------------------------------------------------- /samples-classic/python/getting-started-agents/3p-tools/MiHCM/requirements.txt: -------------------------------------------------------------------------------- 1 | azure-identity==1.19.0 2 | python-dotenv==1.0.1 3 | azure-ai-projects==1.0.0b7 4 | jsonref==1.1.0 5 | # azure-ai-agents -------------------------------------------------------------------------------- /dev-requirements.txt: -------------------------------------------------------------------------------- 1 | tox ~= 4.0 2 | pre-commit ~= 3.0 3 | python-dotenv ~= 1.0 4 | pytest ~= 8.0 5 | pytest-iovis[papermill] == 0.1.0 6 | ipykernel ~= 6.0 7 | .infra/pytest_plugins/changed_samples 8 | -------------------------------------------------------------------------------- /samples-classic/javascript/quickstart/.env.template: -------------------------------------------------------------------------------- 1 | MODEL_DEPLOYMENT_NAME=gpt-4o 2 | PROJECT_ENDPOINT=https://.services.ai.azure.com/api/projects/ -------------------------------------------------------------------------------- /samples-classic/typescript/quickstart/.env.template: -------------------------------------------------------------------------------- 1 | MODEL_DEPLOYMENT_NAME=gpt-4o 2 | PROJECT_ENDPOINT=https://.services.ai.azure.com/api/projects/ 3 | -------------------------------------------------------------------------------- /samples/python/hosted-agents/echo-agent/requirements.txt: -------------------------------------------------------------------------------- 1 | azure-ai-agentserver-agentframework==1.0.0b7 2 | agent-framework 3 | pytest==8.4.2 4 | python-dotenv==1.1.1 5 | azure-monitor-opentelemetry==1.8.1 6 | -------------------------------------------------------------------------------- /samples-classic/python/getting-started-agents/hosted-agents/hugging-face-tool-agent/requirements.txt: -------------------------------------------------------------------------------- 1 | azure_ai_agentserver_agentframework==1.0.0b5 2 | agent-framework 3 | pytest==8.4.2 4 | python-dotenv==1.1.1 5 | -------------------------------------------------------------------------------- /samples/python/hosted-agents/web-search-agent/requirements.txt: -------------------------------------------------------------------------------- 1 | azure-ai-agentserver-agentframework==1.0.0b7 2 | agent-framework 3 | pytest==8.4.2 4 | python-dotenv==1.1.1 5 | azure-monitor-opentelemetry==1.8.1 6 | -------------------------------------------------------------------------------- /migration/.dockerignore: -------------------------------------------------------------------------------- 1 | # Docker-related files 2 | .env 3 | output/ 4 | *.log 5 | 6 | # Python cache 7 | __pycache__/ 8 | *.pyc 9 | *.pyo 10 | 11 | # Migration output 12 | migration_*.json 13 | agent_*.json -------------------------------------------------------------------------------- /samples/csharp/FoundryA365/src/hello_world_a365_agent/wwwroot/favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/azure-ai-foundry/foundry-samples/HEAD/samples/csharp/FoundryA365/src/hello_world_a365_agent/wwwroot/favicon.png -------------------------------------------------------------------------------- /samples-classic/csharp/quickstart/Samples/.env.example: -------------------------------------------------------------------------------- 1 | AZURE_AI_ENDPOINT=https://your.services.ai.azure.com/api/projects/project 2 | AZURE_AI_INFERENCE=https://your.services.ai.azure.com/ 3 | AZURE_AI_MODEL=your_model_name -------------------------------------------------------------------------------- /samples-classic/python/getting-started-agents/3p-tools/Celonis/media/copy.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/azure-ai-foundry/foundry-samples/HEAD/samples-classic/python/getting-started-agents/3p-tools/Celonis/media/copy.png -------------------------------------------------------------------------------- /infrastructure/infrastructure-setup-terraform/00-basic-azurerm/code/providers.tf: -------------------------------------------------------------------------------- 1 | # Setup providers 2 | provider "azurerm" { 3 | features {} 4 | storage_use_azuread = true 5 | subscription_id = var.subscription_id 6 | } 7 | -------------------------------------------------------------------------------- /samples-classic/python/getting-started-agents/3p-tools/Celonis/media/actions.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/azure-ai-foundry/foundry-samples/HEAD/samples-classic/python/getting-started-agents/3p-tools/Celonis/media/actions.png -------------------------------------------------------------------------------- /samples-classic/python/getting-started-agents/3p-tools/Celonis/media/publish.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/azure-ai-foundry/foundry-samples/HEAD/samples-classic/python/getting-started-agents/3p-tools/Celonis/media/publish.png -------------------------------------------------------------------------------- /samples-classic/python/getting-started-agents/3p-tools/Celonis/media/add_action.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/azure-ai-foundry/foundry-samples/HEAD/samples-classic/python/getting-started-agents/3p-tools/Celonis/media/add_action.png -------------------------------------------------------------------------------- /samples-classic/python/getting-started-agents/3p-tools/Celonis/media/connection.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/azure-ai-foundry/foundry-samples/HEAD/samples-classic/python/getting-started-agents/3p-tools/Celonis/media/connection.png -------------------------------------------------------------------------------- /samples-classic/python/getting-started-agents/3p-tools/MiHCM/ArchitectureOverview.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/azure-ai-foundry/foundry-samples/HEAD/samples-classic/python/getting-started-agents/3p-tools/MiHCM/ArchitectureOverview.png -------------------------------------------------------------------------------- /infrastructure/infrastructure-setup-terraform/15a-private-network-standard-agent-setup/code/providers.tf: -------------------------------------------------------------------------------- 1 | # Setup providers 2 | provider "azapi" { 3 | } 4 | 5 | provider "azurerm" { 6 | features {} 7 | storage_use_azuread = true 8 | } 9 | -------------------------------------------------------------------------------- /samples-classic/python/getting-started-agents/3p-tools/Celonis/media/new_asset_menu.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/azure-ai-foundry/foundry-samples/HEAD/samples-classic/python/getting-started-agents/3p-tools/Celonis/media/new_asset_menu.png -------------------------------------------------------------------------------- /samples-classic/python/getting-started-agents/3p-tools/Morningstar/media/custom-keys.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/azure-ai-foundry/foundry-samples/HEAD/samples-classic/python/getting-started-agents/3p-tools/Morningstar/media/custom-keys.png -------------------------------------------------------------------------------- /samples-classic/python/getting-started-agents/3p-tools/Tripadvisor/media/custom-keys.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/azure-ai-foundry/foundry-samples/HEAD/samples-classic/python/getting-started-agents/3p-tools/Tripadvisor/media/custom-keys.png -------------------------------------------------------------------------------- /samples-classic/python/getting-started-agents/3p-tools/Celonis/media/create_copilot_menu.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/azure-ai-foundry/foundry-samples/HEAD/samples-classic/python/getting-started-agents/3p-tools/Celonis/media/create_copilot_menu.png -------------------------------------------------------------------------------- /samples-classic/python/getting-started-agents/3p-tools/Celonis/media/create_custom_tool.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/azure-ai-foundry/foundry-samples/HEAD/samples-classic/python/getting-started-agents/3p-tools/Celonis/media/create_custom_tool.png -------------------------------------------------------------------------------- /samples-classic/python/getting-started-agents/3p-tools/Morningstar/media/project-assets.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/azure-ai-foundry/foundry-samples/HEAD/samples-classic/python/getting-started-agents/3p-tools/Morningstar/media/project-assets.png -------------------------------------------------------------------------------- /samples-classic/python/getting-started-agents/3p-tools/Tripadvisor/media/add-connection.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/azure-ai-foundry/foundry-samples/HEAD/samples-classic/python/getting-started-agents/3p-tools/Tripadvisor/media/add-connection.png -------------------------------------------------------------------------------- /samples-classic/python/getting-started-agents/3p-tools/Tripadvisor/media/add-data-source.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/azure-ai-foundry/foundry-samples/HEAD/samples-classic/python/getting-started-agents/3p-tools/Tripadvisor/media/add-data-source.png -------------------------------------------------------------------------------- /samples-classic/python/getting-started-agents/3p-tools/Tripadvisor/media/project-assets.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/azure-ai-foundry/foundry-samples/HEAD/samples-classic/python/getting-started-agents/3p-tools/Tripadvisor/media/project-assets.png -------------------------------------------------------------------------------- /samples-mistral/pyproject.toml: -------------------------------------------------------------------------------- 1 | [project] 2 | name = "mistral-samples-azure-foundry" 3 | version = "0.1.0" 4 | requires-python = ">=3.11" 5 | dependencies = [ 6 | "httpx>=0.28.1", 7 | "notebook>=7.4.2", 8 | "pymupdf>=1.25.5", 9 | ] 10 | -------------------------------------------------------------------------------- /infrastructure/infrastructure-setup-bicep/42-basic-agent-setup-with-customization/azurebyo.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/azure-ai-foundry/foundry-samples/HEAD/infrastructure/infrastructure-setup-bicep/42-basic-agent-setup-with-customization/azurebyo.PNG -------------------------------------------------------------------------------- /samples-classic/python/getting-started-agents/3p-tools/Morningstar/media/connected-resources.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/azure-ai-foundry/foundry-samples/HEAD/samples-classic/python/getting-started-agents/3p-tools/Morningstar/media/connected-resources.png -------------------------------------------------------------------------------- /samples-classic/python/getting-started-agents/3p-tools/Trademo_Global_trade/custom_connection.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/azure-ai-foundry/foundry-samples/HEAD/samples-classic/python/getting-started-agents/3p-tools/Trademo_Global_trade/custom_connection.png -------------------------------------------------------------------------------- /samples-classic/python/getting-started-agents/3p-tools/Tripadvisor/media/connected-resources.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/azure-ai-foundry/foundry-samples/HEAD/samples-classic/python/getting-started-agents/3p-tools/Tripadvisor/media/connected-resources.png -------------------------------------------------------------------------------- /infrastructure/infrastructure-setup-terraform/00-basic/code/variables.tf: -------------------------------------------------------------------------------- 1 | variable "location" { 2 | description = "The name of the location to provision the resources to" 3 | type = string 4 | } 5 | 6 | variable "subscription_id" { 7 | type = string 8 | } -------------------------------------------------------------------------------- /samples-classic/python/getting-started-agents/3p-tools/Morningstar/media/connect-custom-resource.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/azure-ai-foundry/foundry-samples/HEAD/samples-classic/python/getting-started-agents/3p-tools/Morningstar/media/connect-custom-resource.png -------------------------------------------------------------------------------- /samples-classic/python/getting-started-agents/3p-tools/Tripadvisor/media/connect-custom-resource.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/azure-ai-foundry/foundry-samples/HEAD/samples-classic/python/getting-started-agents/3p-tools/Tripadvisor/media/connect-custom-resource.png -------------------------------------------------------------------------------- /migration/requirements.txt: -------------------------------------------------------------------------------- 1 | # Core dependencies 2 | azure-cosmos==4.5.1 3 | azure-identity==1.15.0 4 | azure-ai-projects==1.0.0 5 | requests==2.31.0 6 | pandas==2.1.4 7 | urllib3==2.1.0 8 | 9 | # Optional dependencies for Azure Function tools 10 | azure-ai-agents -------------------------------------------------------------------------------- /infrastructure/infrastructure-setup-terraform/00-basic-azurerm/code/variables.tf: -------------------------------------------------------------------------------- 1 | variable "location" { 2 | description = "The name of the location to provision the resources to" 3 | type = string 4 | } 5 | 6 | variable "subscription_id" { 7 | type = string 8 | } -------------------------------------------------------------------------------- /samples-classic/python/getting-started-agents/hosted-agents/calculator-agent/requirements.txt: -------------------------------------------------------------------------------- 1 | langgraph==1.0.2 2 | 3 | azure-ai-agentserver-langgraph==1.0.0b3 4 | 5 | pytest==8.4.2 6 | azure-identity==1.25.0 7 | python-dotenv==1.1.1 8 | azure-monitor-opentelemetry==1.8.1 9 | -------------------------------------------------------------------------------- /samples/python/enterprise-agent-tutorial/1-idea-to-prototype/sharepoint-sample-data/remote-work-policy.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/azure-ai-foundry/foundry-samples/HEAD/samples/python/enterprise-agent-tutorial/1-idea-to-prototype/sharepoint-sample-data/remote-work-policy.docx -------------------------------------------------------------------------------- /samples/python/enterprise-agent-tutorial/1-idea-to-prototype/sharepoint-sample-data/security-guidelines.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/azure-ai-foundry/foundry-samples/HEAD/samples/python/enterprise-agent-tutorial/1-idea-to-prototype/sharepoint-sample-data/security-guidelines.docx -------------------------------------------------------------------------------- /samples/python/enterprise-agent-tutorial/1-idea-to-prototype/sharepoint-sample-data/collaboration-standards.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/azure-ai-foundry/foundry-samples/HEAD/samples/python/enterprise-agent-tutorial/1-idea-to-prototype/sharepoint-sample-data/collaboration-standards.docx -------------------------------------------------------------------------------- /samples/python/enterprise-agent-tutorial/1-idea-to-prototype/sharepoint-sample-data/data-governance-policy.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/azure-ai-foundry/foundry-samples/HEAD/samples/python/enterprise-agent-tutorial/1-idea-to-prototype/sharepoint-sample-data/data-governance-policy.docx -------------------------------------------------------------------------------- /samples-classic/python/getting-started-agents/hosted-agents/echo-agent/requirements.txt: -------------------------------------------------------------------------------- 1 | azure-ai-agentserver-agentframework==1.0.0b3 2 | agent-framework 3 | azure-ai-projects==1.1.0b4 4 | 5 | pytest==8.4.2 6 | azure-identity==1.25.0 7 | python-dotenv==1.1.1 8 | azure-monitor-opentelemetry==1.8.1 9 | -------------------------------------------------------------------------------- /samples-classic/python/getting-started-agents/hosted-agents/msft-docs-agent/requirements.txt: -------------------------------------------------------------------------------- 1 | azure-ai-agentserver-agentframework==1.0.0b3 2 | agent-framework 3 | azure-ai-projects==1.1.0b4 4 | 5 | pytest==8.4.2 6 | azure-identity==1.25.0 7 | python-dotenv==1.1.1 8 | azure-monitor-opentelemetry==1.8.1 9 | -------------------------------------------------------------------------------- /samples-classic/python/getting-started-agents/hosted-agents/web-search-agent/requirements.txt: -------------------------------------------------------------------------------- 1 | azure-ai-agentserver-agentframework==1.0.0b3 2 | agent-framework 3 | azure-ai-projects==1.1.0b4 4 | 5 | pytest==8.4.2 6 | azure-identity==1.25.0 7 | python-dotenv==1.1.1 8 | azure-monitor-opentelemetry==1.8.1 9 | -------------------------------------------------------------------------------- /infrastructure/infrastructure-setup-bicep/01-connections/README.md: -------------------------------------------------------------------------------- 1 | # Connections Bicep Examples 2 | 3 | Connections enable your AI applications to access tools and objects managed elsewhere in or outside of Azure. 4 | 5 | This folder provides a set of examples for the most common connection categories. 6 | -------------------------------------------------------------------------------- /infrastructure/infrastructure-setup-terraform/15a-private-network-standard-agent-setup/code/example.tfvars: -------------------------------------------------------------------------------- 1 | location = "westus3" 2 | 3 | # Optional 4 | virtual_network_address_space = "192.168.0.0/16" 5 | agent_subnet_address_prefix = "192.168.0.0/24" 6 | private_endpoint_subnet_address_prefix = "192.168.1.0/24" 7 | -------------------------------------------------------------------------------- /samples/csharp/quickstart/nuget.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /samples/csharp/FoundryA365/src/hello_world_a365_agent/ToolingManifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "mcpServers": [ 3 | { 4 | "mcpServerName": "mcp_OneDriveServer", 5 | "mcpServerUniqueName": "mcp_OneDriveServer" 6 | }, 7 | { 8 | "mcpServerName": "mcp_WordServer", 9 | "mcpServerUniqueName": "mcp_WordServer" 10 | } 11 | ] 12 | } -------------------------------------------------------------------------------- /samples/csharp/FoundryA365/src/hello_world_a365_agent/global.json: -------------------------------------------------------------------------------- 1 | { 2 | "sdk": { 3 | "version": "9.0.305", 4 | "rollForward": "latestFeature" 5 | }, 6 | 7 | "msbuild-sdks": { 8 | "Microsoft.Build.CentralPackageVersions": "2.1.3", 9 | "Microsoft.Build.Traversal": "4.1.82", 10 | "Microsoft.Build.NoTargets": "3.7.56" 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /samples/python/quickstart/.env-template: -------------------------------------------------------------------------------- 1 | # Template for the .env file 2 | # Update with appropriate values 3 | # Rename the file to .env after updating 4 | 5 | AZURE_AI_FOUNDRY_PROJECT_ENDPOINT="https://.services.ai.azure.com/api/projects/" 6 | AZURE_AI_FOUNDRY_AGENT_NAME="MyAgent" 7 | AZURE_AI_FOUNDRY_MODEL_DEPLOYMENT_NAME="gpt-4.1-mini" -------------------------------------------------------------------------------- /samples/csharp/enterprise-agent-tutorial/1-idea-to-prototype/Evaluate/nuget.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /samples/python/hosted-agents/agents_in_workflow/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM python:3.12-slim 2 | 3 | WORKDIR /app 4 | 5 | COPY . user_agent/ 6 | WORKDIR /app/user_agent 7 | 8 | RUN if [ -f requirements.txt ]; then \ 9 | pip install -r requirements.txt; \ 10 | else \ 11 | echo "No requirements.txt found"; \ 12 | fi 13 | 14 | EXPOSE 8088 15 | 16 | CMD ["python", "main.py"] -------------------------------------------------------------------------------- /samples/python/hosted-agents/echo-agent/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM python:3.12-slim 2 | 3 | WORKDIR /app 4 | 5 | COPY . user_agent/ 6 | WORKDIR /app/user_agent 7 | 8 | RUN if [ -f requirements.txt ]; then \ 9 | pip install -r requirements.txt; \ 10 | else \ 11 | echo "No requirements.txt found"; \ 12 | fi 13 | 14 | EXPOSE 8088 15 | 16 | CMD ["python", "main.py"] 17 | -------------------------------------------------------------------------------- /samples/python/hosted-agents/agent_with_hosted_mcp/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM python:3.12-slim 2 | 3 | WORKDIR /app 4 | 5 | COPY . user_agent/ 6 | WORKDIR /app/user_agent 7 | 8 | RUN if [ -f requirements.txt ]; then \ 9 | pip install -r requirements.txt; \ 10 | else \ 11 | echo "No requirements.txt found"; \ 12 | fi 13 | 14 | EXPOSE 8088 15 | 16 | CMD ["python", "main.py"] -------------------------------------------------------------------------------- /samples/python/hosted-agents/calculator-agent/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM python:3.12-slim 2 | 3 | WORKDIR /app 4 | 5 | COPY . user_agent/ 6 | WORKDIR /app/user_agent 7 | 8 | RUN if [ -f requirements.txt ]; then \ 9 | pip install -r requirements.txt; \ 10 | else \ 11 | echo "No requirements.txt found"; \ 12 | fi 13 | 14 | EXPOSE 8088 15 | 16 | CMD ["python", "main.py"] 17 | -------------------------------------------------------------------------------- /samples/python/hosted-agents/web-search-agent/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM python:3.12-slim 2 | 3 | WORKDIR /app 4 | 5 | COPY . user_agent/ 6 | WORKDIR /app/user_agent 7 | 8 | RUN if [ -f requirements.txt ]; then \ 9 | pip install -r requirements.txt; \ 10 | else \ 11 | echo "No requirements.txt found"; \ 12 | fi 13 | 14 | EXPOSE 8088 15 | 16 | CMD ["python", "main.py"] 17 | -------------------------------------------------------------------------------- /samples/csharp/enterprise-agent-tutorial/1-idea-to-prototype/ModernWorkplaceAssistant/nuget.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /samples/python/hosted-agents/agent_with_text_search_rag/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM python:3.12-slim 2 | 3 | WORKDIR /app 4 | 5 | COPY . user_agent/ 6 | WORKDIR /app/user_agent 7 | 8 | RUN if [ -f requirements.txt ]; then \ 9 | pip install -r requirements.txt; \ 10 | else \ 11 | echo "No requirements.txt found"; \ 12 | fi 13 | 14 | EXPOSE 8088 15 | 16 | CMD ["python", "main.py"] -------------------------------------------------------------------------------- /samples/REST/quickstart/quickstart-responses.sh: -------------------------------------------------------------------------------- 1 | curl -X POST https://YOUR-FOUNDRY-RESOURCE-NAME.services.ai.azure.com/api/projects/YOUR-PROJECT-NAME/openai/responses?api-version=2025-11-15-preview \ 2 | -H "Content-Type: application/json" \ 3 | -H "Authorization: Bearer $AZURE_AI_AUTH_TOKEN" \ 4 | -d '{ 5 | "model": "gpt-4.1-mini", 6 | "input": "What is the size of France in square miles?" 7 | }' -------------------------------------------------------------------------------- /samples/csharp/FoundryA365/src/hello_world_a365_agent/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft.AspNetCore": "Warning" 6 | } 7 | }, 8 | "ToolMCPServer": { 9 | "EnableMCPFunctionLogging": true 10 | }, 11 | "AzureStorageConnectionString": "", 12 | "AgentConfiguration": { 13 | "AgentEmailFilter": "" 14 | } -------------------------------------------------------------------------------- /samples-classic/python/getting-started-agents/hosted-agents/echo-agent/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM python:3.11-slim 2 | 3 | WORKDIR /app 4 | 5 | COPY . user_agent/ 6 | WORKDIR /app/user_agent 7 | 8 | RUN if [ -f requirements.txt ]; then \ 9 | pip install -r requirements.txt; \ 10 | else \ 11 | echo "No requirements.txt found"; \ 12 | fi 13 | 14 | EXPOSE 8088 15 | 16 | CMD ["python", "main.py"] 17 | -------------------------------------------------------------------------------- /.infra/deployment/modules/container_registry.bicep: -------------------------------------------------------------------------------- 1 | param name string 2 | param location string = resourceGroup().id 3 | 4 | resource containerRegistry 'Microsoft.ContainerRegistry/registries@2022-02-01-preview' = { 5 | name: name 6 | location: location 7 | sku: { 8 | name: 'Standard' 9 | } 10 | properties: { 11 | adminUserEnabled: false 12 | } 13 | } 14 | 15 | output id string = containerRegistry.id -------------------------------------------------------------------------------- /samples-classic/python/getting-started-agents/agent-framework/agents_in_workflow/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM python:3.12-slim 2 | 3 | WORKDIR /app 4 | 5 | COPY . user_agent/ 6 | WORKDIR /app/user_agent 7 | 8 | RUN if [ -f requirements.txt ]; then \ 9 | pip install -r requirements.txt; \ 10 | else \ 11 | echo "No requirements.txt found"; \ 12 | fi 13 | 14 | EXPOSE 8088 15 | 16 | CMD ["python", "main.py"] -------------------------------------------------------------------------------- /samples-classic/python/getting-started-agents/hosted-agents/calculator-agent/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM python:3.11-slim 2 | 3 | WORKDIR /app 4 | 5 | COPY . user_agent/ 6 | WORKDIR /app/user_agent 7 | 8 | RUN if [ -f requirements.txt ]; then \ 9 | pip install -r requirements.txt; \ 10 | else \ 11 | echo "No requirements.txt found"; \ 12 | fi 13 | 14 | EXPOSE 8088 15 | 16 | CMD ["python", "main.py"] 17 | -------------------------------------------------------------------------------- /samples-classic/python/getting-started-agents/hosted-agents/msft-docs-agent/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM python:3.11-slim 2 | 3 | WORKDIR /app 4 | 5 | COPY . user_agent/ 6 | WORKDIR /app/user_agent 7 | 8 | RUN if [ -f requirements.txt ]; then \ 9 | pip install -r requirements.txt; \ 10 | else \ 11 | echo "No requirements.txt found"; \ 12 | fi 13 | 14 | EXPOSE 8088 15 | 16 | CMD ["python", "main.py"] 17 | -------------------------------------------------------------------------------- /samples-classic/python/getting-started-agents/hosted-agents/web-search-agent/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM python:3.11-slim 2 | 3 | WORKDIR /app 4 | 5 | COPY . user_agent/ 6 | WORKDIR /app/user_agent 7 | 8 | RUN if [ -f requirements.txt ]; then \ 9 | pip install -r requirements.txt; \ 10 | else \ 11 | echo "No requirements.txt found"; \ 12 | fi 13 | 14 | EXPOSE 8088 15 | 16 | CMD ["python", "main.py"] 17 | -------------------------------------------------------------------------------- /samples-classic/python/getting-started-agents/agent-framework/agent_with_hosted_mcp/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM python:3.12-slim 2 | 3 | WORKDIR /app 4 | 5 | COPY . user_agent/ 6 | WORKDIR /app/user_agent 7 | 8 | RUN if [ -f requirements.txt ]; then \ 9 | pip install -r requirements.txt; \ 10 | else \ 11 | echo "No requirements.txt found"; \ 12 | fi 13 | 14 | EXPOSE 8088 15 | 16 | CMD ["python", "main.py"] -------------------------------------------------------------------------------- /samples-classic/python/getting-started-agents/agent-framework/agent_with_text_search_rag/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM python:3.12-slim 2 | 3 | WORKDIR /app 4 | 5 | COPY . user_agent/ 6 | WORKDIR /app/user_agent 7 | 8 | RUN if [ -f requirements.txt ]; then \ 9 | pip install -r requirements.txt; \ 10 | else \ 11 | echo "No requirements.txt found"; \ 12 | fi 13 | 14 | EXPOSE 8088 15 | 16 | CMD ["python", "main.py"] -------------------------------------------------------------------------------- /samples-classic/python/getting-started-agents/hosted-agents/hugging-face-tool-agent/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM python:3.11-slim 2 | 3 | WORKDIR /app 4 | 5 | COPY . user_agent/ 6 | WORKDIR /app/user_agent 7 | 8 | RUN if [ -f requirements.txt ]; then \ 9 | pip install -r requirements.txt; \ 10 | else \ 11 | echo "No requirements.txt found"; \ 12 | fi 13 | 14 | EXPOSE 8088 15 | 16 | CMD ["python", "main.py"] 17 | -------------------------------------------------------------------------------- /samples/python/hosted-agents/code-interpreter-custom/pyproject.toml: -------------------------------------------------------------------------------- 1 | [project] 2 | name = "code-interpreter-custom" 3 | version = "0.1.0" 4 | description = "Basic example for using custom code interpreter session pools." 5 | readme = "README.md" 6 | requires-python = ">=3.12" 7 | dependencies = [ 8 | "aiohttp>=3.13.2", 9 | "azure-ai-projects==2.0.0b2", 10 | "azure-identity>=1.25.1", 11 | "dotenv>=0.9.9", 12 | "openai>=2.8.1", 13 | ] 14 | -------------------------------------------------------------------------------- /samples/typescript/enterprise-agent-tutorial/1-idea-to-prototype/.gitignore: -------------------------------------------------------------------------------- 1 | # Dependencies 2 | node_modules/ 3 | package-lock.json 4 | 5 | # Build outputs 6 | dist/ 7 | *.tsbuildinfo 8 | 9 | # Environment variables 10 | .env 11 | 12 | # Evaluation results 13 | evaluation_results.json 14 | 15 | # Logs 16 | *.log 17 | npm-debug.log* 18 | 19 | # OS files 20 | .DS_Store 21 | Thumbs.db 22 | 23 | # IDE 24 | .vscode/ 25 | .idea/ 26 | *.swp 27 | *.swo 28 | *~ 29 | -------------------------------------------------------------------------------- /CODE_OF_CONDUCT.md: -------------------------------------------------------------------------------- 1 | # Microsoft Open Source Code of Conduct 2 | 3 | This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). 4 | 5 | Resources: 6 | 7 | - [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/) 8 | - [Microsoft Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) 9 | - Contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with questions or concerns 10 | -------------------------------------------------------------------------------- /samples/csharp/FoundryA365/src/hello_world_a365_agent/AgentLogic/AgentConfiguration.cs: -------------------------------------------------------------------------------- 1 | namespace HelloWorldA365.AgentLogic; 2 | 3 | public static class AgentConfiguration 4 | { 5 | public static string? GetAgentEmailFilter(this IConfiguration configuration) => 6 | configuration.GetValue("AgentConfiguration:AgentEmailFilter"); 7 | 8 | public static string? GetCertificateData(this IConfiguration configuration) => 9 | configuration["agent-blueprint-secret"]; 10 | } -------------------------------------------------------------------------------- /.infra/deployment/modules/keyvault.bicep: -------------------------------------------------------------------------------- 1 | param name string 2 | param location string = resourceGroup().location 3 | param tenantId string = tenant().tenantId 4 | 5 | resource keyVault 'Microsoft.KeyVault/vaults@2022-07-01' = { 6 | name: name 7 | location: location 8 | properties: { 9 | tenantId: tenantId 10 | sku: { 11 | name: 'standard' 12 | family: 'A' 13 | } 14 | accessPolicies: [] 15 | enableSoftDelete: true 16 | } 17 | } 18 | 19 | output id string = keyVault.id -------------------------------------------------------------------------------- /infrastructure/infrastructure-setup-terraform/15a-private-network-standard-agent-setup/code/locals.tf: -------------------------------------------------------------------------------- 1 | locals { 2 | project_id_guid = "${substr(azapi_resource.ai_foundry_project.output.properties.internalId, 0, 8)}-${substr(azapi_resource.ai_foundry_project.output.properties.internalId, 8, 4)}-${substr(azapi_resource.ai_foundry_project.output.properties.internalId, 12, 4)}-${substr(azapi_resource.ai_foundry_project.output.properties.internalId, 16, 4)}-${substr(azapi_resource.ai_foundry_project.output.properties.internalId, 20, 12)}" 3 | } 4 | -------------------------------------------------------------------------------- /samples/csharp/FoundryA365/azure.yaml: -------------------------------------------------------------------------------- 1 | name: foundry-a365 2 | 3 | hooks: 4 | postprovision: 5 | shell: pwsh 6 | run: ./scripts/post-provision.ps1 7 | interactive: true 8 | continueOnError: false 9 | 10 | # services: 11 | # web: 12 | # project: ./src 13 | # language: csharp 14 | # host: foundry.containeragent 15 | # hooks: 16 | # # This hook runs before this specific service is built 17 | # prebuild: 18 | # posix: 19 | # shell: sh 20 | # run: ./service-prebuild.sh -------------------------------------------------------------------------------- /infrastructure/infrastructure-setup-terraform/15b-private-network-standard-agent-setup-byovnet/code/locals.tf: -------------------------------------------------------------------------------- 1 | locals { 2 | project_id_guid = "${substr(azapi_resource.ai_foundry_project.output.properties.internalId, 0, 8)}-${substr(azapi_resource.ai_foundry_project.output.properties.internalId, 8, 4)}-${substr(azapi_resource.ai_foundry_project.output.properties.internalId, 12, 4)}-${substr(azapi_resource.ai_foundry_project.output.properties.internalId, 16, 4)}-${substr(azapi_resource.ai_foundry_project.output.properties.internalId, 20, 12)}" 3 | } 4 | -------------------------------------------------------------------------------- /samples/typescript/enterprise-agent-tutorial/1-idea-to-prototype/.env.template: -------------------------------------------------------------------------------- 1 | # Azure AI Foundry Configuration 2 | PROJECT_ENDPOINT=https://your-project-endpoint.services.ai.azure.com/api/projects/your-project-name 3 | MODEL_DEPLOYMENT_NAME=gpt-4o-mini 4 | AI_FOUNDRY_TENANT_ID=your-tenant-id 5 | 6 | # Microsoft Learn MCP Server (Works out-of-the-box!) 7 | MCP_SERVER_URL=https://learn.microsoft.com/api/mcp 8 | 9 | # SharePoint Integration (Optional - requires additional setup) 10 | SHAREPOINT_RESOURCE_NAME=ContosoCorpPoliciesProcedures 11 | -------------------------------------------------------------------------------- /samples/REST/quickstart/quickstart-create-agent.sh: -------------------------------------------------------------------------------- 1 | curl -X POST https://YOUR-FOUNDRY-RESOURCE-NAME.services.ai.azure.com/api/projects/YOUR-PROJECT-NAME/agents?api-version=2025-11-15-preview \ 2 | -H "Content-Type: application/json" \ 3 | -H "Authorization: Bearer $AZURE_AI_AUTH_TOKEN" \ 4 | -d '{ 5 | "name": "MyAgent", 6 | "definition": { 7 | "kind": "prompt", 8 | "model": "gpt-4.1-mini", 9 | "instructions": "You are a helpful assistant that answers general questions" 10 | } 11 | }' -------------------------------------------------------------------------------- /.github/workflows/pre-commit.yml: -------------------------------------------------------------------------------- 1 | name: Pre-Commit 2 | 3 | 4 | on: 5 | # push: 6 | # branches: 7 | # - main 8 | # pull_request: 9 | # branches: 10 | # - main 11 | workflow_dispatch: 12 | 13 | jobs: 14 | pre-commit: 15 | runs-on: ubuntu-latest 16 | steps: 17 | - uses: actions/checkout@v3 18 | - uses: actions/setup-python@v4 19 | with: 20 | python-version: "3.9" 21 | - run: pip install -r dev-requirements.txt 22 | - name: Run Pre-Commit 23 | run: pre-commit run --all-files 24 | -------------------------------------------------------------------------------- /infrastructure/infrastructure-setup-bicep/42-basic-agent-setup-with-customization/main.parameters.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentParameters.json#", 3 | "contentVersion": "1.0.0.0", 4 | "parameters": { 5 | "location": { 6 | "value": "westus" 7 | }, 8 | "ai_services": { 9 | "value": "aiServices" 10 | }, 11 | "project_name": { 12 | "value": "project" 13 | }, 14 | "existingAoaiResourceId": { 15 | "value": "byo-oai-resource-id" 16 | } 17 | } 18 | } -------------------------------------------------------------------------------- /tox.ini: -------------------------------------------------------------------------------- 1 | [tox] 2 | min_version = 4.0 3 | 4 | [testenv] 5 | skip_install = true 6 | 7 | [testenv:black] 8 | deps = 9 | black[jupyter] ~= 23.0 10 | commands = black {posargs} 11 | 12 | [testenv:ruff] 13 | deps = 14 | ruff ~= 0.9.4 15 | commands = ruff {posargs} 16 | 17 | [testenv:nb-clean] 18 | deps = 19 | nb-clean ~= 3.0 20 | commands = nb-clean {posargs} 21 | 22 | [testenv:typos] 23 | deps = 24 | typos ~= 1.16.0 25 | commands = typos {posargs} 26 | 27 | [testenv:pytest] 28 | deps = 29 | -r dev-requirements.txt 30 | commands = pytest {posargs} 31 | 32 | 33 | -------------------------------------------------------------------------------- /infrastructure/infrastructure-setup-bicep/20-user-assigned-identity/metadata.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://aka.ms/azure-quickstart-templates-metadata-schema#", 3 | "itemDisplayName": "Creates an AI Foundry using User-Assigned Identity", 4 | "description": "This template allows you to create an AI Foundry account and project using User-Assigned Identity.", 5 | "summary": "This template allows you to create an AI Foundry account and project using User-Assigned Identity.", 6 | "githubUsername": "andyaviles121", 7 | "dateUpdated": "2025-04-16", 8 | "type": "QuickStart" 9 | } -------------------------------------------------------------------------------- /infrastructure/infrastructure-setup-terraform/00-basic/code/versions.tf: -------------------------------------------------------------------------------- 1 | # Configure the AzApi and AzureRM providers 2 | terraform { 3 | required_providers { 4 | azapi = { 5 | source = "azure/azapi" 6 | version = "~> 2.5" 7 | } 8 | azurerm = { 9 | source = "hashicorp/azurerm" 10 | version = "~> 4.37" 11 | } 12 | random = { 13 | source = "hashicorp/random" 14 | version = "~> 3.7" 15 | } 16 | } 17 | required_version = ">= 1.10.0, < 2.0.0" 18 | # Uncomment to store state in Azure Storage 19 | # backend "azurerm" {} 20 | } 21 | -------------------------------------------------------------------------------- /.infra/pytest_plugins/changed_samples/src/pytest_changed_samples.egg-info/SOURCES.txt: -------------------------------------------------------------------------------- 1 | README.md 2 | pyproject.toml 3 | src/pytest_changed_samples/__init__.py 4 | src/pytest_changed_samples/git_utils.py 5 | src/pytest_changed_samples/plugin.py 6 | src/pytest_changed_samples/trie.py 7 | src/pytest_changed_samples.egg-info/PKG-INFO 8 | src/pytest_changed_samples.egg-info/SOURCES.txt 9 | src/pytest_changed_samples.egg-info/dependency_links.txt 10 | src/pytest_changed_samples.egg-info/entry_points.txt 11 | src/pytest_changed_samples.egg-info/requires.txt 12 | src/pytest_changed_samples.egg-info/top_level.txt -------------------------------------------------------------------------------- /infrastructure/infrastructure-setup-bicep/01-connections/deployment.parameters.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentParameters.json#", 3 | "contentVersion": "1.0.0.0", 4 | "parameters": { 5 | "aiFoundryName": { 6 | "value": "" 7 | }, 8 | "connectedResourceName": { 9 | "value": "" 10 | }, 11 | "location": { 12 | "value": "westus" 13 | }, 14 | "newOrExisting": { 15 | "value": "new" 16 | } 17 | } 18 | } -------------------------------------------------------------------------------- /infrastructure/infrastructure-setup-terraform/00-basic-azurerm/code/versions.tf: -------------------------------------------------------------------------------- 1 | # Configure the AzApi and AzureRM providers 2 | terraform { 3 | required_providers { 4 | azapi = { 5 | source = "azure/azapi" 6 | version = "~> 2.5" 7 | } 8 | azurerm = { 9 | source = "hashicorp/azurerm" 10 | version = "~> 4.37" 11 | } 12 | random = { 13 | source = "hashicorp/random" 14 | version = "~> 3.7" 15 | } 16 | } 17 | required_version = ">= 1.10.0, < 2.0.0" 18 | # Uncomment to store state in Azure Storage 19 | # backend "azurerm" {} 20 | } 21 | -------------------------------------------------------------------------------- /.infra/deployment/modules/role_assignment.bicep: -------------------------------------------------------------------------------- 1 | param principalId string 2 | param principalType string 3 | param roleDefinitionId string 4 | 5 | resource roleDefinition 'Microsoft.Authorization/roleDefinitions@2022-04-01' existing = { 6 | scope: resourceGroup() 7 | name: roleDefinitionId 8 | } 9 | 10 | resource roleAssignment 'Microsoft.Authorization/roleAssignments@2022-04-01' = { 11 | name: guid(resourceGroup().id, principalId, roleDefinition.id) 12 | properties: { 13 | roleDefinitionId: roleDefinition.id 14 | principalId: principalId 15 | principalType: principalType 16 | } 17 | } -------------------------------------------------------------------------------- /samples-classic/python/quickstart/README.md: -------------------------------------------------------------------------------- 1 | 2 | ## Install dependencies 3 | 4 | - install azure CLI 5 | - pip install azure-ai-projects openai azure-identity 6 | - az login 7 | 8 | ## Create a project and model deployment 9 | 10 | see: create_project.py 11 | 12 | ## Run a chat completion 13 | 14 | see: quickstart.py 15 | 16 | ## Create and run an agent 17 | 18 | see: quickstart.py 19 | 20 | ## Add file search to agent 21 | 22 | see: quickstart.py 23 | 24 | ## Evaluate agent run 25 | 26 | This will return scores for how good the agent performed on the task 27 | 28 | see: quickstart.py 29 | -------------------------------------------------------------------------------- /infrastructure/infrastructure-setup-bicep/18-managed-virtual-network-preview/modules-network-secured/subnet.bicep: -------------------------------------------------------------------------------- 1 | @description('Name of the virtual network') 2 | param vnetName string 3 | 4 | @description('Name of the subnet') 5 | param subnetName string 6 | 7 | @description('Address prefix for the subnet') 8 | param addressPrefix string 9 | 10 | resource subnet 'Microsoft.Network/virtualNetworks/subnets@2024-05-01' = { 11 | name: '${vnetName}/${subnetName}' 12 | properties: { 13 | addressPrefix: addressPrefix 14 | } 15 | } 16 | 17 | output subnetId string = subnet.id 18 | output subnetName string = subnetName 19 | -------------------------------------------------------------------------------- /.infra/deployment/modules/ai_project.bicep: -------------------------------------------------------------------------------- 1 | param name string 2 | param nameFriendly string = name 3 | param workspaceHubID string 4 | param location string = resourceGroup().location 5 | 6 | resource project 'Microsoft.MachineLearningServices/workspaces@2023-10-01' = { 7 | name: name 8 | #disable-next-line BCP187 9 | kind: 'Project' 10 | location: location 11 | identity: { 12 | type: 'SystemAssigned' 13 | } 14 | properties: { 15 | friendlyName: nameFriendly 16 | #disable-next-line BCP037 17 | hubResourceId: workspaceHubID 18 | } 19 | } 20 | 21 | output name string = project.name 22 | output location string = project.location -------------------------------------------------------------------------------- /infrastructure/infrastructure-setup-bicep/15-private-network-standard-agent-setup/metadata.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://aka.ms/azure-quickstart-templates-metadata-schema#", 3 | "type": "QuickStart", 4 | "itemDisplayName": "Network Secured Standard Agent Setup", 5 | "description": "This set of templates demonstrates how to set up Azure AI Agent Service with the network secured standard setup environment.", 6 | "summary": "This set of templates demonstrates how to use Azure AI Agent Service with the your own virtual network.", 7 | "githubUsername": "fosteramanda", 8 | "dateUpdated": "2025-06-24", 9 | "environments": [ 10 | "AzureCloud" 11 | ] 12 | } -------------------------------------------------------------------------------- /infrastructure/infrastructure-setup-bicep/18-managed-virtual-network-preview/metadata.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://aka.ms/azure-quickstart-templates-metadata-schema#", 3 | "type": "QuickStart", 4 | "itemDisplayName": "Managed Network Secured Standard Agent Setup", 5 | "description": "This set of templates demonstrates how to set up Azure AI Agent Service with the managed network secured standard setup environment.", 6 | "summary": "This set of templates demonstrates how to use Azure AI Agent Service with a managed virtual network.", 7 | "githubUsername": "meerakurup", 8 | "dateUpdated": "2025-12-17", 9 | "environments": [ 10 | "AzureCloud" 11 | ] 12 | } -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Azure AI Foundry Documentation Samples 2 | 3 | This repository acts as the top-level directory for official Azure AI Foundry documentation sample code and examples. It includes notebooks and sample code that contain end-to-end examples as well as smaller code snippets for common developer tasks. 4 | 5 | This repository is entirely open source, guidance on how to contribute and links to additional repositories are provided below. 6 | 7 | Use the samples in this repository to try out Azure AI Foundry scenarios on your local machine! 8 | 9 | ## Contributing 10 | 11 | We welcome contributions and suggestions! Please see the [contributing guidelines] for details. 12 | 13 | -------------------------------------------------------------------------------- /infrastructure/infrastructure-setup-bicep/16-private-network-standard-agent-apim-setup-preview/metadata.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://aka.ms/azure-quickstart-templates-metadata-schema#", 3 | "type": "QuickStart", 4 | "itemDisplayName": "Network Secured Standard Agent Setup", 5 | "description": "This set of templates demonstrates how to set up Azure AI Agent Service with the network secured standard setup environment.", 6 | "summary": "This set of templates demonstrates how to use Azure AI Agent Service with the your own virtual network.", 7 | "githubUsername": "fosteramanda", 8 | "dateUpdated": "2025-06-24", 9 | "environments": [ 10 | "AzureCloud" 11 | ] 12 | } -------------------------------------------------------------------------------- /infrastructure/infrastructure-setup-bicep/41-standard-agent-setup/modules-standard/format-project-workspace-id.bicep: -------------------------------------------------------------------------------- 1 | 2 | param projectWorkspaceId string 3 | 4 | var part1 = substring(projectWorkspaceId, 0, 8) // First 8 characters 5 | var part2 = substring(projectWorkspaceId, 8, 4) // Next 4 characters 6 | var part3 = substring(projectWorkspaceId, 12, 4) // Next 4 characters 7 | var part4 = substring(projectWorkspaceId, 16, 4) // Next 4 characters 8 | var part5 = substring(projectWorkspaceId, 20, 12) // Remaining 12 characters 9 | 10 | var formattedGuid = '${part1}-${part2}-${part3}-${part4}-${part5}' 11 | 12 | output projectWorkspaceIdGuid string = formattedGuid 13 | -------------------------------------------------------------------------------- /samples/typescript/enterprise-agent-tutorial/1-idea-to-prototype/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "ES2022", 4 | "module": "commonjs", 5 | "lib": ["ES2022"], 6 | "outDir": "./dist", 7 | "rootDir": "./src", 8 | "strict": true, 9 | "esModuleInterop": true, 10 | "skipLibCheck": true, 11 | "forceConsistentCasingInFileNames": true, 12 | "moduleResolution": "node", 13 | "resolveJsonModule": true, 14 | "declaration": true, 15 | "declarationMap": true, 16 | "sourceMap": true 17 | }, 18 | "include": ["src/main-simple.ts"], 19 | "exclude": ["node_modules", "dist", "src/main.ts", "src/evaluate.ts"] 20 | } 21 | -------------------------------------------------------------------------------- /samples/csharp/hosted-agents/AgentWithHostedMCP/Dockerfile: -------------------------------------------------------------------------------- 1 | # Build the application 2 | FROM mcr.microsoft.com/dotnet/sdk:9.0-alpine AS build 3 | WORKDIR /src 4 | 5 | # Copy files from the current directory on the host to the working directory in the container 6 | COPY . . 7 | 8 | RUN dotnet restore 9 | RUN dotnet build -c Release --no-restore 10 | RUN dotnet publish -c Release --no-build -o /app 11 | 12 | # Run the application 13 | FROM mcr.microsoft.com/dotnet/aspnet:9.0-alpine AS final 14 | WORKDIR /app 15 | 16 | # Copy everything needed to run the app from the "build" stage. 17 | COPY --from=build /app . 18 | 19 | EXPOSE 8088 20 | ENTRYPOINT ["dotnet", "AgentWithHostedMCP.dll"] 21 | -------------------------------------------------------------------------------- /samples/csharp/hosted-agents/AgentsInWorkflows/Dockerfile: -------------------------------------------------------------------------------- 1 | # Build the application 2 | FROM mcr.microsoft.com/dotnet/sdk:9.0-alpine AS build 3 | WORKDIR /src 4 | 5 | # Copy files from the current directory on the host to the working directory in the container 6 | COPY . . 7 | 8 | RUN dotnet restore 9 | RUN dotnet build -c Release --no-restore 10 | RUN dotnet publish -c Release --no-build -o /app 11 | 12 | # Run the application 13 | FROM mcr.microsoft.com/dotnet/aspnet:9.0-alpine AS final 14 | WORKDIR /app 15 | 16 | # Copy everything needed to run the app from the "build" stage. 17 | COPY --from=build /app . 18 | 19 | EXPOSE 8088 20 | ENTRYPOINT ["dotnet", "AgentsInWorkflows.dll"] 21 | -------------------------------------------------------------------------------- /infrastructure/infrastructure-setup-bicep/17-private-network-standard-user-assigned-identity-agent-setup/metadata.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://aka.ms/azure-quickstart-templates-metadata-schema#", 3 | "type": "QuickStart", 4 | "itemDisplayName": "Network Secured Standard Agent Setup", 5 | "description": "This set of templates demonstrates how to set up Azure AI Agent Service with the network secured standard setup environment.", 6 | "summary": "This set of templates demonstrates how to use Azure AI Agent Service with the your own virtual network.", 7 | "githubUsername": "fosteramanda", 8 | "dateUpdated": "2025-06-24", 9 | "environments": [ 10 | "AzureCloud" 11 | ] 12 | } -------------------------------------------------------------------------------- /infrastructure/infrastructure-setup-bicep/18-managed-virtual-network-preview/modules-network-secured/format-project-workspace-id.bicep: -------------------------------------------------------------------------------- 1 | 2 | param projectWorkspaceId string 3 | 4 | var part1 = substring(projectWorkspaceId, 0, 8) // First 8 characters 5 | var part2 = substring(projectWorkspaceId, 8, 4) // Next 4 characters 6 | var part3 = substring(projectWorkspaceId, 12, 4) // Next 4 characters 7 | var part4 = substring(projectWorkspaceId, 16, 4) // Next 4 characters 8 | var part5 = substring(projectWorkspaceId, 20, 12) // Remaining 12 characters 9 | 10 | var formattedGuid = '${part1}-${part2}-${part3}-${part4}-${part5}' 11 | 12 | output projectWorkspaceIdGuid string = formattedGuid 13 | -------------------------------------------------------------------------------- /samples/csharp/hosted-agents/AgentWithTextSearchRag/Dockerfile: -------------------------------------------------------------------------------- 1 | # Build the application 2 | FROM mcr.microsoft.com/dotnet/sdk:9.0-alpine AS build 3 | WORKDIR /src 4 | 5 | # Copy files from the current directory on the host to the working directory in the container 6 | COPY . . 7 | 8 | RUN dotnet restore 9 | RUN dotnet build -c Release --no-restore 10 | RUN dotnet publish -c Release --no-build -o /app 11 | 12 | # Run the application 13 | FROM mcr.microsoft.com/dotnet/aspnet:9.0-alpine AS final 14 | WORKDIR /app 15 | 16 | # Copy everything needed to run the app from the "build" stage. 17 | COPY --from=build /app . 18 | 19 | EXPOSE 8088 20 | ENTRYPOINT ["dotnet", "AgentWithTextSearchRag.dll"] 21 | -------------------------------------------------------------------------------- /infrastructure/infrastructure-setup-bicep/15-private-network-standard-agent-setup/modules-network-secured/format-project-workspace-id.bicep: -------------------------------------------------------------------------------- 1 | 2 | param projectWorkspaceId string 3 | 4 | var part1 = substring(projectWorkspaceId, 0, 8) // First 8 characters 5 | var part2 = substring(projectWorkspaceId, 8, 4) // Next 4 characters 6 | var part3 = substring(projectWorkspaceId, 12, 4) // Next 4 characters 7 | var part4 = substring(projectWorkspaceId, 16, 4) // Next 4 characters 8 | var part5 = substring(projectWorkspaceId, 20, 12) // Remaining 12 characters 9 | 10 | var formattedGuid = '${part1}-${part2}-${part3}-${part4}-${part5}' 11 | 12 | output projectWorkspaceIdGuid string = formattedGuid 13 | -------------------------------------------------------------------------------- /infrastructure/infrastructure-setup-bicep/43-standard-agent-setup-with-customization/modules-standard/format-project-workspace-id.bicep: -------------------------------------------------------------------------------- 1 | 2 | param projectWorkspaceId string 3 | 4 | var part1 = substring(projectWorkspaceId, 0, 8) // First 8 characters 5 | var part2 = substring(projectWorkspaceId, 8, 4) // Next 4 characters 6 | var part3 = substring(projectWorkspaceId, 12, 4) // Next 4 characters 7 | var part4 = substring(projectWorkspaceId, 16, 4) // Next 4 characters 8 | var part5 = substring(projectWorkspaceId, 20, 12) // Remaining 12 characters 9 | 10 | var formattedGuid = '${part1}-${part2}-${part3}-${part4}-${part5}' 11 | 12 | output projectWorkspaceIdGuid string = formattedGuid 13 | -------------------------------------------------------------------------------- /.infra/deployment/modules/storageAccount.bicep: -------------------------------------------------------------------------------- 1 | param name string 2 | param location string = resourceGroup().location 3 | 4 | resource storageAccount 'Microsoft.Storage/storageAccounts@2022-05-01' = { 5 | name: name 6 | location: location 7 | sku: { 8 | name: 'Standard_LRS' 9 | } 10 | kind: 'StorageV2' 11 | properties: { 12 | encryption: { 13 | services: { 14 | blob: { 15 | enabled: true 16 | } 17 | file: { 18 | enabled: true 19 | } 20 | } 21 | keySource: 'Microsoft.Storage' 22 | } 23 | supportsHttpsTrafficOnly: true 24 | minimumTlsVersion: 'TLS1_2' 25 | } 26 | } 27 | 28 | output id string = storageAccount.id -------------------------------------------------------------------------------- /infrastructure/infrastructure-setup-bicep/30-customer-managed-keys/deployment.parameters.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentParameters.json#", 3 | "contentVersion": "1.0.0.0", 4 | "parameters": { 5 | "aiFoundryName": { 6 | "value": "" 7 | }, 8 | "location": { 9 | "value": "eastus2" 10 | }, 11 | "keyVaultName": { 12 | "value": "" 13 | }, 14 | "keyName": { 15 | "value": "" 16 | }, 17 | "keyVersion": { 18 | "value": "" 19 | } 20 | } 21 | } -------------------------------------------------------------------------------- /infrastructure/infrastructure-setup-bicep/16-private-network-standard-agent-apim-setup-preview/modules-network-secured/format-project-workspace-id.bicep: -------------------------------------------------------------------------------- 1 | 2 | param projectWorkspaceId string 3 | 4 | var part1 = substring(projectWorkspaceId, 0, 8) // First 8 characters 5 | var part2 = substring(projectWorkspaceId, 8, 4) // Next 4 characters 6 | var part3 = substring(projectWorkspaceId, 12, 4) // Next 4 characters 7 | var part4 = substring(projectWorkspaceId, 16, 4) // Next 4 characters 8 | var part5 = substring(projectWorkspaceId, 20, 12) // Remaining 12 characters 9 | 10 | var formattedGuid = '${part1}-${part2}-${part3}-${part4}-${part5}' 11 | 12 | output projectWorkspaceIdGuid string = formattedGuid 13 | -------------------------------------------------------------------------------- /samples-classic/csharp/getting-started-agents/AgentFramework/AgentsInWorkflows/Dockerfile: -------------------------------------------------------------------------------- 1 | # Build the application 2 | FROM mcr.microsoft.com/dotnet/sdk:9.0-alpine AS build 3 | WORKDIR /src 4 | 5 | # Copy files from the current directory on the host to the working directory in the container 6 | COPY . . 7 | 8 | RUN dotnet restore 9 | RUN dotnet build -c Release --no-restore 10 | RUN dotnet publish -c Release --no-build -o /app 11 | 12 | # Run the application 13 | FROM mcr.microsoft.com/dotnet/aspnet:9.0-alpine AS final 14 | WORKDIR /app 15 | 16 | # Copy everything needed to run the app from the "build" stage. 17 | COPY --from=build /app . 18 | 19 | EXPOSE 8088 20 | ENTRYPOINT ["dotnet", "AgentsInWorkflows.dll"] 21 | -------------------------------------------------------------------------------- /samples/java/enterprise-agent-tutorial/1-idea-to-prototype/.gitignore: -------------------------------------------------------------------------------- 1 | # Environment variables 2 | .env 3 | 4 | # Maven 5 | target/ 6 | pom.xml.tag 7 | pom.xml.releaseBackup 8 | pom.xml.versionsBackup 9 | pom.xml.next 10 | release.properties 11 | dependency-reduced-pom.xml 12 | buildNumber.properties 13 | .mvn/timing.properties 14 | .mvn/wrapper/maven-wrapper.jar 15 | 16 | # Java 17 | *.class 18 | *.jar 19 | *.war 20 | *.ear 21 | *.log 22 | *.ctxt 23 | .mtj.tmp/ 24 | hs_err_pid* 25 | 26 | # IDE 27 | .idea/ 28 | *.iml 29 | .vscode/ 30 | .settings/ 31 | .project 32 | .classpath 33 | *.swp 34 | *.swo 35 | *~ 36 | 37 | # Evaluation results 38 | evaluation_results.json 39 | 40 | # OS 41 | .DS_Store 42 | Thumbs.db 43 | -------------------------------------------------------------------------------- /infrastructure/infrastructure-setup-terraform/15a-private-network-standard-agent-setup/code/versions.tf: -------------------------------------------------------------------------------- 1 | # Configure the AzApi and AzureRM providers 2 | terraform { 3 | required_providers { 4 | azapi = { 5 | source = "azure/azapi" 6 | version = "~> 2.5" 7 | } 8 | azurerm = { 9 | source = "hashicorp/azurerm" 10 | version = "~> 4.37" 11 | } 12 | random = { 13 | source = "hashicorp/random" 14 | version = "~> 3.7" 15 | } 16 | time = { 17 | source = "hashicorp/time" 18 | version = "~> 0.13" 19 | } 20 | } 21 | required_version = ">= 1.10.0, < 2.0.0" 22 | # Uncomment to store state in Azure Storage 23 | # backend "azurerm" {} 24 | } 25 | -------------------------------------------------------------------------------- /samples-classic/csharp/getting-started-agents/AgentFramework/AgentWithHostedMCP/Dockerfile: -------------------------------------------------------------------------------- 1 | # Build the application 2 | FROM mcr.microsoft.com/dotnet/sdk:9.0-alpine AS build 3 | WORKDIR /src 4 | 5 | # Copy files from the current directory on the host to the working directory in the container 6 | COPY . . 7 | 8 | RUN dotnet restore 9 | RUN dotnet build -c Release --no-restore 10 | RUN dotnet publish -c Release --no-build -o /app 11 | 12 | # Run the application 13 | FROM mcr.microsoft.com/dotnet/aspnet:9.0-alpine AS final 14 | WORKDIR /app 15 | 16 | # Copy everything needed to run the app from the "build" stage. 17 | COPY --from=build /app . 18 | 19 | EXPOSE 8088 20 | ENTRYPOINT ["dotnet", "AgentWithHostedMCP.dll"] 21 | -------------------------------------------------------------------------------- /infrastructure/infrastructure-setup-bicep/17-private-network-standard-user-assigned-identity-agent-setup/modules-network-secured/format-project-workspace-id.bicep: -------------------------------------------------------------------------------- 1 | 2 | param projectWorkspaceId string 3 | 4 | var part1 = substring(projectWorkspaceId, 0, 8) // First 8 characters 5 | var part2 = substring(projectWorkspaceId, 8, 4) // Next 4 characters 6 | var part3 = substring(projectWorkspaceId, 12, 4) // Next 4 characters 7 | var part4 = substring(projectWorkspaceId, 16, 4) // Next 4 characters 8 | var part5 = substring(projectWorkspaceId, 20, 12) // Remaining 12 characters 9 | 10 | var formattedGuid = '${part1}-${part2}-${part3}-${part4}-${part5}' 11 | 12 | output projectWorkspaceIdGuid string = formattedGuid 13 | -------------------------------------------------------------------------------- /infrastructure/infrastructure-setup-terraform/15b-private-network-standard-agent-setup-byovnet/code/versions.tf: -------------------------------------------------------------------------------- 1 | # Configure the AzApi and AzureRM providers 2 | terraform { 3 | required_providers { 4 | azapi = { 5 | source = "azure/azapi" 6 | version = "~> 2.5" 7 | } 8 | azurerm = { 9 | source = "hashicorp/azurerm" 10 | version = "~> 4.37" 11 | } 12 | random = { 13 | source = "hashicorp/random" 14 | version = "~> 3.7" 15 | } 16 | time = { 17 | source = "hashicorp/time" 18 | version = "~> 0.13" 19 | } 20 | } 21 | required_version = ">= 1.10.0, < 2.0.0" 22 | # Uncomment to store state in Azure Storage 23 | # backend "azurerm" {} 24 | } 25 | -------------------------------------------------------------------------------- /samples-classic/csharp/getting-started-agents/AgentFramework/AgentWithTextSearchRag/Dockerfile: -------------------------------------------------------------------------------- 1 | # Build the application 2 | FROM mcr.microsoft.com/dotnet/sdk:9.0-alpine AS build 3 | WORKDIR /src 4 | 5 | # Copy files from the current directory on the host to the working directory in the container 6 | COPY . . 7 | 8 | RUN dotnet restore 9 | RUN dotnet build -c Release --no-restore 10 | RUN dotnet publish -c Release --no-build -o /app 11 | 12 | # Run the application 13 | FROM mcr.microsoft.com/dotnet/aspnet:9.0-alpine AS final 14 | WORKDIR /app 15 | 16 | # Copy everything needed to run the app from the "build" stage. 17 | COPY --from=build /app . 18 | 19 | EXPOSE 8088 20 | ENTRYPOINT ["dotnet", "AgentWithTextSearchRag.dll"] 21 | -------------------------------------------------------------------------------- /samples/python/hosted-agents/echo-agent/README.md: -------------------------------------------------------------------------------- 1 | ## Troubleshooting 2 | 3 | ### Images built on Apple Silicon or other ARM64 machines do not work on our service 4 | 5 | We **recommend using `azd` cloud build**, which always builds images with the correct architecture. 6 | 7 | If you choose to **build locally**, and your machine is **not `linux/amd64`** (for example, an Apple Silicon Mac), the image will **not be compatible with our service**, causing runtime failures. 8 | 9 | **Fix for local builds** 10 | 11 | Add this line at the top of your `Dockerfile`: 12 | 13 | ```dockerfile 14 | FROM --platform=linux/amd64 python:3.12-slim 15 | ``` 16 | 17 | This forces the image to be built for the required `amd64` architecture. 18 | -------------------------------------------------------------------------------- /samples/csharp/enterprise-agent-tutorial/1-idea-to-prototype/Evaluate/Evaluate.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Exe 5 | net9.0 6 | enable 7 | enable 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /samples/python/hosted-agents/calculator-agent/README.md: -------------------------------------------------------------------------------- 1 | ## Troubleshooting 2 | 3 | ### Images built on Apple Silicon or other ARM64 machines do not work on our service 4 | 5 | We **recommend using `azd` cloud build**, which always builds images with the correct architecture. 6 | 7 | If you choose to **build locally**, and your machine is **not `linux/amd64`** (for example, an Apple Silicon Mac), the image will **not be compatible with our service**, causing runtime failures. 8 | 9 | **Fix for local builds** 10 | 11 | Add this line at the top of your `Dockerfile`: 12 | 13 | ```dockerfile 14 | FROM --platform=linux/amd64 python:3.12-slim 15 | ``` 16 | 17 | This forces the image to be built for the required `amd64` architecture. 18 | -------------------------------------------------------------------------------- /samples/python/hosted-agents/web-search-agent/README.md: -------------------------------------------------------------------------------- 1 | ## Troubleshooting 2 | 3 | ### Images built on Apple Silicon or other ARM64 machines do not work on our service 4 | 5 | We **recommend using `azd` cloud build**, which always builds images with the correct architecture. 6 | 7 | If you choose to **build locally**, and your machine is **not `linux/amd64`** (for example, an Apple Silicon Mac), the image will **not be compatible with our service**, causing runtime failures. 8 | 9 | **Fix for local builds** 10 | 11 | Add this line at the top of your `Dockerfile`: 12 | 13 | ```dockerfile 14 | FROM --platform=linux/amd64 python:3.12-slim 15 | ``` 16 | 17 | This forces the image to be built for the required `amd64` architecture. 18 | -------------------------------------------------------------------------------- /infrastructure/infrastructure-setup-bicep/18-managed-virtual-network-preview/update-outbound-rules-cli/outbound-rule-cdb.json: -------------------------------------------------------------------------------- 1 | { 2 | "id": "/subscriptions/{sub-id}/resourceGroups/{rg-name}/providers/Microsoft.CognitiveServices/accounts/{foundry-resource-name}/managednetworks/default/outboundRules/test-rule-cdb", 3 | "name": "test-rule-cdb", 4 | "type": "Microsoft.CognitiveServices/accounts/managednetworks/outboundRules", 5 | "properties": { 6 | "type": "PrivateEndpoint", 7 | "destination": { 8 | "serviceResourceId": "/subscriptions/{sub-id}/resourceGroups/{rg-name}/providers/Microsoft.DocumentDB/databaseAccounts/{cdb-name}", 9 | "subresourceTarget": "Sql" 10 | }, 11 | "category": "UserDefined" 12 | } 13 | } -------------------------------------------------------------------------------- /infrastructure/infrastructure-setup-bicep/18-managed-virtual-network-preview/update-outbound-rules-cli/outbound-rule-storage.json: -------------------------------------------------------------------------------- 1 | { 2 | "id": "/subscriptions/{sub-id}/resourceGroups/{rg-name}/providers/Microsoft.CognitiveServices/accounts/{foundry-account-name}/managednetworks/default/outboundRules/test-rule-str", 3 | "name": "test-rule-str", 4 | "type": "Microsoft.CognitiveServices/accounts/managednetworks/outboundRules", 5 | "properties": { 6 | "type": "PrivateEndpoint", 7 | "destination": { 8 | "serviceResourceId": "/subscriptions/{sub-id}/resourceGroups/{rg-name}/providers/Microsoft.Storage/storageAccounts/{storage-account}", 9 | "subresourceTarget": "blob" 10 | }, 11 | "category": "UserDefined" 12 | } 13 | } -------------------------------------------------------------------------------- /infrastructure/infrastructure-setup-bicep/15-private-network-standard-agent-setup/modules-network-secured/subnet.bicep: -------------------------------------------------------------------------------- 1 | @description('Name of the virtual network') 2 | param vnetName string 3 | 4 | @description('Name of the subnet') 5 | param subnetName string 6 | 7 | @description('Address prefix for the subnet') 8 | param addressPrefix string 9 | 10 | @description('Array of subnet delegations') 11 | param delegations array = [] 12 | 13 | resource subnet 'Microsoft.Network/virtualNetworks/subnets@2024-05-01' = { 14 | name: '${vnetName}/${subnetName}' 15 | properties: { 16 | addressPrefix: addressPrefix 17 | delegations: delegations 18 | } 19 | } 20 | 21 | output subnetId string = subnet.id 22 | output subnetName string = subnetName 23 | -------------------------------------------------------------------------------- /samples/csharp/hosted-agents/AgentsInWorkflows/run-requests.http: -------------------------------------------------------------------------------- 1 | @host = http://localhost:8088 2 | @endpoint = {{host}}/responses 3 | 4 | ### Health Check 5 | GET {{host}}/readiness 6 | 7 | ### Simple string input 8 | POST {{endpoint}} 9 | Content-Type: application/json 10 | { 11 | "input": "Hello, how are you today?" 12 | } 13 | 14 | ### Explicit input 15 | POST {{endpoint}} 16 | Content-Type: application/json 17 | { 18 | "input": [ 19 | { 20 | "type": "message", 21 | "role": "user", 22 | "content": [ 23 | { 24 | "type": "input_text", 25 | "text": "Hello, how are you today?" 26 | } 27 | ] 28 | } 29 | ] 30 | } 31 | -------------------------------------------------------------------------------- /infrastructure/infrastructure-setup-bicep/16-private-network-standard-agent-apim-setup-preview/modules-network-secured/subnet.bicep: -------------------------------------------------------------------------------- 1 | @description('Name of the virtual network') 2 | param vnetName string 3 | 4 | @description('Name of the subnet') 5 | param subnetName string 6 | 7 | @description('Address prefix for the subnet') 8 | param addressPrefix string 9 | 10 | @description('Array of subnet delegations') 11 | param delegations array = [] 12 | 13 | resource subnet 'Microsoft.Network/virtualNetworks/subnets@2024-05-01' = { 14 | name: '${vnetName}/${subnetName}' 15 | properties: { 16 | addressPrefix: addressPrefix 17 | delegations: delegations 18 | } 19 | } 20 | 21 | output subnetId string = subnet.id 22 | output subnetName string = subnetName 23 | -------------------------------------------------------------------------------- /infrastructure/infrastructure-setup-bicep/18-managed-virtual-network-preview/update-outbound-rules-cli/outbound-rule-search.json: -------------------------------------------------------------------------------- 1 | { 2 | "id": "/subscriptions/{sub-id}/resourceGroups/{rg-name}/providers/Microsoft.CognitiveServices/accounts/{foundry-account-name}/managednetworks/default/outboundRules/test-rule-search", 3 | "name": "test-rule-search", 4 | "type": "Microsoft.CognitiveServices/accounts/managednetworks/outboundRules", 5 | "properties": { 6 | "type": "PrivateEndpoint", 7 | "destination": { 8 | "serviceResourceId": "/subscriptions/{sub-id}/resourceGroups/{rg-name}/providers/Microsoft.Search/searchServices/{search-service-name}", 9 | "subresourceTarget": "searchService" 10 | }, 11 | "category": "UserDefined" 12 | } 13 | } -------------------------------------------------------------------------------- /infrastructure/infrastructure-setup-terraform/15b-private-network-standard-agent-setup-byovnet/code/example.tfvars: -------------------------------------------------------------------------------- 1 | resource_group_name_resources = "myfoundryrg" 2 | resource_group_name_dns = "mydnsrg" 3 | subnet_id_agent = "/subscriptions/55555555-5555-5555-5555-555555555555/resourceGroups/myfoundryrg/providers/Microsoft.Network/virtualNetworks/vnetfoundry/subnets/snet-agent" 4 | subnet_id_private_endpoint = "/subscriptions/55555555-5555-5555-5555-555555555555/resourceGroups/myfoundryrg/providers/Microsoft.Network/virtualNetworks/vnetfoundry/subnets/snet-svc" 5 | subscription_id_resources = "55555555-5555-5555-5555-555555555555" 6 | subscription_id_infra = "44444444-4444-4444-4444-444444444444" 7 | location = "westus3" 8 | -------------------------------------------------------------------------------- /samples/csharp/enterprise-agent-tutorial/1-idea-to-prototype/ModernWorkplaceAssistant/ModernWorkplaceAssistant.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Exe 5 | net8.0 6 | enable 7 | Program 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /infrastructure/infrastructure-setup-bicep/10-private-network-basic/README.md: -------------------------------------------------------------------------------- 1 | # Deploy AI Foundry with a private network configuration 2 | 3 | > **NOTE:** This examples shows how to disable public network access for Azure AI Foundry. This template includes: 4 | * PNA disabled Foundry resource (account) with private endpoint 5 | 6 | 7 | ## Steps 8 | 9 | 1. Create new (or use existing) resource group: 10 | 11 | ```bash 12 | az group create --name --location 13 | ``` 14 | 15 | 2. Deploy the main.bicep 16 | 17 | ```bash 18 | az deployment group create --resource-group --template-file main.bicep 19 | ``` 20 | 21 | **NOTE:** To access your Foundry resource securely, please using either a VM, VPN, or ExpressRoute. -------------------------------------------------------------------------------- /infrastructure/infrastructure-setup-bicep/17-private-network-standard-user-assigned-identity-agent-setup/modules-network-secured/subnet.bicep: -------------------------------------------------------------------------------- 1 | @description('Name of the virtual network') 2 | param vnetName string 3 | 4 | @description('Name of the subnet') 5 | param subnetName string 6 | 7 | @description('Address prefix for the subnet') 8 | param addressPrefix string 9 | 10 | @description('Array of subnet delegations') 11 | param delegations array = [] 12 | 13 | resource subnet 'Microsoft.Network/virtualNetworks/subnets@2024-05-01' = { 14 | name: '${vnetName}/${subnetName}' 15 | properties: { 16 | addressPrefix: addressPrefix 17 | delegations: delegations 18 | } 19 | } 20 | 21 | output subnetId string = subnet.id 22 | output subnetName string = subnetName 23 | -------------------------------------------------------------------------------- /samples/csharp/FoundryA365/.gitignore: -------------------------------------------------------------------------------- 1 | #azd 2 | .azure/ 3 | 4 | # Build results 5 | [Dd]ebug/ 6 | [Dd]ebugPublic/ 7 | [Rr]elease/ 8 | [Rr]eleases/ 9 | x64/ 10 | x86/ 11 | [Ww][Ii][Nn]32/ 12 | [Aa][Rr][Mm]/ 13 | [Aa][Rr][Mm]64/ 14 | bld/ 15 | [Bb]in/ 16 | [Oo]bj/ 17 | [Ll]og/ 18 | [Ll]ogs/ 19 | 20 | # .NET Core 21 | project.lock.json 22 | project.fragment.lock.json 23 | artifacts/ 24 | 25 | # ASP.NET Scaffolding 26 | ScaffoldingReadMe.txt 27 | 28 | # NuGet Packages 29 | *.nupkg 30 | # NuGet Symbol Packages 31 | *.snupkg 32 | 33 | # Others 34 | ~$* 35 | *~ 36 | CodeCoverage/ 37 | 38 | # MSBuild Binary and Structured Log 39 | *.binlog 40 | 41 | # MSTest test Results 42 | [Tt]est[Rr]esult*/ 43 | [Bb]uild[Ll]og.* 44 | 45 | # NUnit 46 | *.VisualState.xml 47 | TestResult.xml 48 | nunit-*.xml -------------------------------------------------------------------------------- /infrastructure/infrastructure-setup-bicep/40-basic-agent-setup/basic-setup.parameters.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentParameters.json#", 3 | "contentVersion": "1.0.0.0", 4 | "parameters": { 5 | "location": { 6 | "value": "eastus" 7 | }, 8 | "aiServicesName": { 9 | "value": "aiServices" 10 | }, 11 | "projectName": { 12 | "value": "project" 13 | }, 14 | "modelName": { 15 | "value": "gpt-4o" 16 | }, 17 | "modelFormat": { 18 | "value": "OpenAI" 19 | }, 20 | "modelVersion": { 21 | "value": "2024-11-20" 22 | }, 23 | "modelSkuName": { 24 | "value": "GlobalStandard" 25 | }, 26 | "modelCapacity": { 27 | "value": 1 28 | } 29 | } 30 | } -------------------------------------------------------------------------------- /samples-classic/csharp/getting-started-agents/AgentFramework/AgentsInWorkflows/run-requests.http: -------------------------------------------------------------------------------- 1 | @host = http://localhost:8088 2 | @endpoint = {{host}}/responses 3 | 4 | ### Health Check 5 | GET {{host}}/readiness 6 | 7 | ### Simple string input 8 | POST {{endpoint}} 9 | Content-Type: application/json 10 | { 11 | "input": "Hello, how are you today?" 12 | } 13 | 14 | ### Explicit input 15 | POST {{endpoint}} 16 | Content-Type: application/json 17 | { 18 | "input": [ 19 | { 20 | "type": "message", 21 | "role": "user", 22 | "content": [ 23 | { 24 | "type": "input_text", 25 | "text": "Hello, how are you today?" 26 | } 27 | ] 28 | } 29 | ] 30 | } 31 | -------------------------------------------------------------------------------- /samples/python/quickstart/quickstart-responses.py: -------------------------------------------------------------------------------- 1 | import os 2 | from dotenv import load_dotenv 3 | from azure.identity import DefaultAzureCredential 4 | from azure.ai.projects import AIProjectClient 5 | 6 | load_dotenv() 7 | 8 | print(f"Using PROJECT_ENDPOINT: {os.environ['PROJECT_ENDPOINT']}") 9 | print(f"Using MODEL_DEPLOYMENT_NAME: {os.environ['MODEL_DEPLOYMENT_NAME']}") 10 | 11 | project_client = AIProjectClient( 12 | endpoint=os.environ["PROJECT_ENDPOINT"], 13 | credential=DefaultAzureCredential(), 14 | ) 15 | 16 | openai_client = project_client.get_openai_client() 17 | 18 | response = openai_client.responses.create( 19 | model=os.environ["MODEL_DEPLOYMENT_NAME"], 20 | input="What is the size of France in square miles?", 21 | ) 22 | print(f"Response output: {response.output_text}") -------------------------------------------------------------------------------- /infrastructure/infrastructure-setup-bicep/00-basic/metadata.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://aka.ms/azure-quickstart-templates-metadata-schema#", 3 | "type": "QuickStart", 4 | "itemDisplayName": "Azure AI Foundry project basic setup", 5 | "description": "This set of templates demonstrates how to set up Azure AI Foundry project with the basic setup, meaning with public internet access enabled, Microsoft-managed keys for encryption and Microsoft-managed identity configuration.", 6 | "summary": "This set of templates demonstrates how to set up Azure AI Foundry with the basic setup. This is the recommended way to get started with Azure AI Foundry.", 7 | "githubUsername": "andyaviles121", 8 | "dateUpdated": "2025-04-09", 9 | "environments": [ 10 | "AzureCloud" 11 | ] 12 | } -------------------------------------------------------------------------------- /samples/csharp/hosted-agents/AgentWithTextSearchRag/run-requests.http: -------------------------------------------------------------------------------- 1 | @host = http://localhost:8088 2 | @endpoint = {{host}}/responses 3 | 4 | ### Health Check 5 | GET {{host}}/readiness 6 | 7 | ### Simple string input 8 | POST {{endpoint}} 9 | Content-Type: application/json 10 | { 11 | "input": "Hi! I need help understanding the return policy." 12 | } 13 | 14 | ### Explicit input 15 | POST {{endpoint}} 16 | Content-Type: application/json 17 | { 18 | "input": [ 19 | { 20 | "type": "message", 21 | "role": "user", 22 | "content": [ 23 | { 24 | "type": "input_text", 25 | "text": "How long does standard shipping usually take?" 26 | } 27 | ] 28 | } 29 | ] 30 | } 31 | -------------------------------------------------------------------------------- /.github/workflows/pull-request-checks.yml: -------------------------------------------------------------------------------- 1 | name: Pull Request Checks 2 | 3 | on: 4 | # push: 5 | # branches: 6 | # - main 7 | # pull_request: 8 | # branches: 9 | # - main 10 | workflow_dispatch: 11 | 12 | jobs: 13 | pull_request_size: 14 | if: github.event_name == 'pull_request' 15 | runs-on: ubuntu-latest 16 | steps: 17 | - uses: actions/checkout@v3 18 | - uses: actions/setup-python@v4 19 | with: 20 | python-version: "3.9" 21 | - name: Check Pull Request Size 22 | run: | 23 | git fetch origin ${{ github.event.pull_request.base.ref }} --quiet # Need to manually fetch base branch in CI 24 | python ./.github/scripts/commit-filesize-diff-summary.py --limit 1MB origin/${{ github.event.pull_request.base.ref }}..HEAD 25 | -------------------------------------------------------------------------------- /samples-classic/typescript/quickstart/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "ES2022", 4 | "module": "ESNext", 5 | "moduleResolution": "node", 6 | "allowSyntheticDefaultImports": true, 7 | "esModuleInterop": true, 8 | "allowJs": true, 9 | "strict": true, 10 | "skipLibCheck": true, 11 | "forceConsistentCasingInFileNames": true, 12 | "resolveJsonModule": true, 13 | "isolatedModules": true, 14 | "noEmit": false, 15 | "outDir": "./dist", 16 | "rootDir": "./src", 17 | "declaration": true, 18 | "declarationMap": true, 19 | "sourceMap": true, 20 | "lib": ["ES2022", "DOM"], 21 | "types": ["node"] 22 | }, 23 | "include": [ 24 | "src/**/*" 25 | ], 26 | "exclude": [ 27 | "node_modules", 28 | "dist" 29 | ] 30 | } 31 | -------------------------------------------------------------------------------- /samples/python/hosted-agents/echo-agent/agent.yaml: -------------------------------------------------------------------------------- 1 | # Unique identifier/name for this agent 2 | name: echo-agent 3 | # Brief description of what this agent does 4 | description: > 5 | This sample demonstrates how to create a custom AI agent that echoes user input. 6 | It is useful for testing, debugging, and learning how to build custom agents. 7 | metadata: 8 | # Categorization tags for organizing and discovering agents 9 | tags: 10 | - AI Agent Hosting 11 | - Azure AI AgentServer 12 | - Custom Agent Implementation 13 | - Microsoft Agent Framework 14 | template: 15 | name: echo-agent 16 | kind: hosted 17 | protocols: 18 | - protocol: responses 19 | version: v1 20 | environment_variables: 21 | - name: AZURE_AI_PROJECT_ENDPOINT 22 | value: ${AZURE_AI_PROJECT_ENDPOINT} 23 | -------------------------------------------------------------------------------- /samples/python/quickstart/quickstart-create-agent.py: -------------------------------------------------------------------------------- 1 | import os 2 | from dotenv import load_dotenv 3 | from azure.identity import DefaultAzureCredential 4 | from azure.ai.projects import AIProjectClient 5 | from azure.ai.projects.models import PromptAgentDefinition 6 | 7 | load_dotenv() 8 | 9 | project_client = AIProjectClient( 10 | endpoint=os.environ["PROJECT_ENDPOINT"], 11 | credential=DefaultAzureCredential(), 12 | ) 13 | 14 | agent = project_client.agents.create_version( 15 | agent_name=os.environ["AGENT_NAME"], 16 | definition=PromptAgentDefinition( 17 | model=os.environ["MODEL_DEPLOYMENT_NAME"], 18 | instructions="You are a helpful assistant that answers general questions", 19 | ), 20 | ) 21 | print(f"Agent created (id: {agent.id}, name: {agent.name}, version: {agent.version})") -------------------------------------------------------------------------------- /samples-classic/csharp/getting-started-agents/AgentFramework/AgentWithTextSearchRag/run-requests.http: -------------------------------------------------------------------------------- 1 | @host = http://localhost:8088 2 | @endpoint = {{host}}/responses 3 | 4 | ### Health Check 5 | GET {{host}}/readiness 6 | 7 | ### Simple string input 8 | POST {{endpoint}} 9 | Content-Type: application/json 10 | { 11 | "input": "Hi! I need help understanding the return policy." 12 | } 13 | 14 | ### Explicit input 15 | POST {{endpoint}} 16 | Content-Type: application/json 17 | { 18 | "input": [ 19 | { 20 | "type": "message", 21 | "role": "user", 22 | "content": [ 23 | { 24 | "type": "input_text", 25 | "text": "How long does standard shipping usually take?" 26 | } 27 | ] 28 | } 29 | ] 30 | } 31 | -------------------------------------------------------------------------------- /samples-classic/python/getting-started-agents/hosted-agents/hugging-face-tool-agent/agent.yaml: -------------------------------------------------------------------------------- 1 | name: HuggingFace-Agent 2 | description: Hugging Face agent 3 | metadata: 4 | example: 5 | - role: user 6 | content: |- 7 | What's are the trending models in the OpenLLM Leaderboard? 8 | tags: 9 | - Microsoft Agent Framework 10 | template: 11 | name: HuggingFace-Agent 12 | kind: hosted 13 | environment_variables: 14 | - name: AZURE_OPENAI_ENDPOINT 15 | value: ${AZURE_OPENAI_ENDPOINT} 16 | - name: OPENAI_API_VERSION 17 | value: 2025-03-01-preview 18 | - name: AZURE_OPENAI_CHAT_DEPLOYMENT_NAME 19 | value: "{{chat}}" 20 | - name: AZURE_AI_PROJECT_TOOL_CONNECTION_ID 21 | value: "HuggingFaceMCPServer" 22 | resources: 23 | - kind: model 24 | id: gpt-5 25 | name: chat 26 | -------------------------------------------------------------------------------- /samples-classic/python/getting-started-agents/hosted-agents/echo-agent/agent.yaml: -------------------------------------------------------------------------------- 1 | # Unique identifier/name for this agent 2 | name: echo-agent 3 | # Brief description of what this agent does 4 | description: > 5 | This sample demonstrates how to create a custom AI agent that echoes user input. 6 | It is useful for testing, debugging, and learning how to build custom agents. 7 | metadata: 8 | # Categorization tags for organizing and discovering agents 9 | tags: 10 | - AI Agent Hosting 11 | - Azure AI AgentServer 12 | - Custom Agent Implementation 13 | - Microsoft Agent Framework 14 | template: 15 | name: echo-agent 16 | kind: hosted 17 | protocols: 18 | - protocol: responses 19 | version: v1 20 | environment_variables: 21 | - name: AZURE_AI_PROJECT_ENDPOINT 22 | value: ${AZURE_AI_PROJECT_ENDPOINT} 23 | -------------------------------------------------------------------------------- /samples/csharp/hosted-agents/AgentsInWorkflows/AgentsInWorkflows.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Exe 5 | net9.0 6 | 7 | enable 8 | enable 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /samples/csharp/hosted-agents/AgentWithTextSearchRag/AgentWithTextSearchRag.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Exe 5 | net9.0 6 | 7 | enable 8 | enable 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /infrastructure/infrastructure-setup-bicep/25-entraid-passthrough/README.md: -------------------------------------------------------------------------------- 1 | # Azure AI Agent Service: Standard Agent Setup 1RP with Private E2E Networking 2 | 3 | > **NOTE:** This template is to set-up a connection to a storage account and assign entraID passthrough for your storage resource. This includes creating: 4 | * a Foundry resource 5 | * A storage account (the one other resource to connect to) 6 | * Azure storage connection with EntraID passthrough auth 7 | * Storage Blob Data Owner role assignment for project MSI on storage 8 | 9 | ## Steps 10 | 11 | 1. Create new (or use existing) resource group: 12 | 13 | ```bash 14 | az group create --name --location eastus 15 | ``` 16 | 17 | 2. Deploy the main-create.bicep 18 | 19 | ```bash 20 | az deployment group create --resource-group --template-file main.bicep 21 | ``` 22 | -------------------------------------------------------------------------------- /samples/typescript/quickstart/src/quickstart-responses.ts: -------------------------------------------------------------------------------- 1 | import { DefaultAzureCredential } from "@azure/identity"; 2 | import { AIProjectClient } from "@azure/ai-projects"; 3 | import "dotenv/config"; 4 | 5 | const projectEndpoint = process.env["PROJECT_ENDPOINT"] || ""; 6 | const deploymentName = process.env["MODEL_DEPLOYMENT_NAME"] || ""; 7 | 8 | async function main(): Promise { 9 | const project = new AIProjectClient(projectEndpoint, new DefaultAzureCredential()); 10 | const openAIClient = await project.getOpenAIClient(); 11 | const response = await openAIClient.responses.create({ 12 | model: deploymentName, 13 | input: "What is the size of France in square miles?", 14 | }); 15 | console.log(`Response output: ${response.output_text}`); 16 | } 17 | 18 | main().catch(console.error); -------------------------------------------------------------------------------- /samples-classic/python/getting-started-agents/hosted-agents/msft-docs-agent/agent.yaml: -------------------------------------------------------------------------------- 1 | name: msft-learn-mcp-agent 2 | description: This Agent can access and search Microsoft Learn documentation using MCP (Model Context Protocol) with tool call approval. 3 | metadata: 4 | tags: 5 | - AI Agent Hosting 6 | - Azure AI AgentServer 7 | - MCP 8 | - Microsoft Agent Framework 9 | - Tool Call Approval 10 | authors: 11 | - jeomhove 12 | template: 13 | name: msft-learn-mcp-agent 14 | kind: hosted 15 | protocols: 16 | - protocol: responses 17 | version: v1 18 | environment_variables: 19 | - name: AZURE_AI_PROJECT_ENDPOINT 20 | value: ${AZURE_AI_PROJECT_ENDPOINT} 21 | - name: AZURE_AI_MODEL_DEPLOYMENT_NAME 22 | value: "{{chat}}" 23 | resources: 24 | - kind: model 25 | id: gpt-4o-mini 26 | name: chat 27 | 28 | -------------------------------------------------------------------------------- /infrastructure/infrastructure-setup-bicep/45-basic-agent-bing/README.md: -------------------------------------------------------------------------------- 1 | # Azure AI Foundry Agent Service: Basic Agent Setup with the Bing Search Tool 2 | 3 | Use this template as a starting point for creating a basic agent project where you know you will want to create agents with the Grounding with Bing Search tool. For more information, see [Azure AI Services Agents Environment Setup](https://learn.microsoft.com/en-us/azure/ai-services/agents/environment-setup). 4 | 5 | > **Note:** Deploying the template does not create an agent; it only provisions the necessary resources to get started. 6 | 7 | 8 | ## Getting started 9 | 10 | Creating your first agent with Azure AI Foundry Agent Service is a two-step process: 11 | 12 | 1. **Set up your agent environment.** 13 | 2. **Create and configure your agent** using either your preferred SDK or the Azure Foundry Portal. 14 | 15 | -------------------------------------------------------------------------------- /samples-classic/csharp/getting-started-agents/AgentFramework/AgentsInWorkflows/AgentsInWorkflows.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Exe 5 | net9.0 6 | 7 | enable 8 | enable 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /samples/csharp/hosted-agents/AgentWithHostedMCP/run-requests.http: -------------------------------------------------------------------------------- 1 | @host = http://localhost:8088 2 | @endpoint = {{host}}/responses 3 | 4 | ### Health Check 5 | GET {{host}}/readiness 6 | 7 | ### Simple string input - Ask about MCP Tools 8 | POST {{endpoint}} 9 | Content-Type: application/json 10 | { 11 | "input": "Please summarize the Azure AI Agent documentation related to MCP Tool calling?" 12 | } 13 | 14 | ### Explicit input - Ask about Agent Framework 15 | POST {{endpoint}} 16 | Content-Type: application/json 17 | { 18 | "input": [ 19 | { 20 | "type": "message", 21 | "role": "user", 22 | "content": [ 23 | { 24 | "type": "input_text", 25 | "text": "What is the Microsoft Agent Framework?" 26 | } 27 | ] 28 | } 29 | ] 30 | } 31 | -------------------------------------------------------------------------------- /infrastructure/infrastructure-setup-bicep/43-standard-agent-setup-with-customization/azuredeploy.parameters.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentParameters.json#", 3 | "contentVersion": "1.0.0.0", 4 | "parameters": { 5 | "location": { 6 | "value": "westus" 7 | }, 8 | "aiFoundryName": { 9 | "value": "" 10 | }, 11 | "foundryProjectName": { 12 | "value": "" 13 | }, 14 | "aiSearchResourceId": { 15 | "value": "" 16 | }, 17 | "azureStorageAccountResourceId": { 18 | "value": "" 19 | }, 20 | "azureCosmosDBAccountResourceId": { 21 | "value": "" 22 | }, 23 | "existingAoaiResourceId": { 24 | "value": "" 25 | }, 26 | "projectCapHost": { 27 | "value": "" 28 | }, 29 | "accountCapHost": { 30 | "value": "" 31 | } 32 | } 33 | } -------------------------------------------------------------------------------- /samples-classic/csharp/getting-started-agents/AgentFramework/AgentWithTextSearchRag/AgentWithTextSearchRag.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Exe 5 | net9.0 6 | 7 | enable 8 | enable 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /samples-classic/javascript/quickstart/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "foundry-samples-quickstart", 3 | "version": "1.0.0", 4 | "description": "JavaScript AI Foundry Quickstart", 5 | "homepage": "https://github.com/azure-ai-foundry/foundry-samples#readme", 6 | "bugs": { 7 | "url": "https://github.com/azure-ai-foundry/foundry-samples/issues" 8 | }, 9 | "repository": { 10 | "type": "git", 11 | "url": "https://github.com/azure-ai-foundry/foundry-samples.git" 12 | }, 13 | "license": "MIT", 14 | "author": "Dan Wahlin, Julia Muiruri", 15 | "type": "module", 16 | "main": "src/quickstart.js", 17 | "scripts": { 18 | "start": "node --no-deprecation src/quickstart.js" 19 | }, 20 | "dependencies": { 21 | "@azure/ai-projects": "1.0.0", 22 | "@azure/ai-agents": "1.1.0", 23 | "@azure/identity": "^4.11.1", 24 | "dotenv": "^17.2.1" 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /infrastructure/infrastructure-setup-bicep/32-customer-managed-keys-user-assigned-identity/deployment.parameters.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", 3 | "contentVersion": "1.0.0.0", 4 | "parameters": { 5 | "aiFoundryName": { 6 | "value": "" 7 | }, 8 | "location": { 9 | "value": "" 10 | }, 11 | "keyVaultName": { 12 | "value": "" 13 | }, 14 | "keyName": { 15 | "value": "<>your key name>" 16 | }, 17 | "keyVersion": { 18 | "value": "" 19 | }, 20 | "userAssignedIdentityId": { 21 | "value": "" 22 | }, 23 | "userAssignedIdentityClientId": { 24 | "value": "" 25 | } 26 | } 27 | } -------------------------------------------------------------------------------- /infrastructure/infrastructure-setup-terraform/15b-private-network-standard-agent-setup-byovnet/code/providers.tf: -------------------------------------------------------------------------------- 1 | # Setup providers 2 | provider "azapi" { 3 | } 4 | 5 | provider "azapi" { 6 | alias = "workload_subscription" 7 | subscription_id = var.subscription_id_resources 8 | } 9 | 10 | provider "azapi" { 11 | alias = "infra_subscription" 12 | subscription_id = var.subscription_id_infra 13 | } 14 | 15 | provider "azurerm" { 16 | features {} 17 | storage_use_azuread = true 18 | } 19 | 20 | provider "azurerm" { 21 | alias = "workload_subscription" 22 | subscription_id = var.subscription_id_resources 23 | features {} 24 | storage_use_azuread = true 25 | } 26 | 27 | provider "azurerm" { 28 | alias = "infra_subscription" 29 | subscription_id = var.subscription_id_infra 30 | features {} 31 | storage_use_azuread = true 32 | } 33 | -------------------------------------------------------------------------------- /samples-classic/csharp/getting-started-agents/AgentFramework/AgentWithHostedMCP/run-requests.http: -------------------------------------------------------------------------------- 1 | @host = http://localhost:8088 2 | @endpoint = {{host}}/responses 3 | 4 | ### Health Check 5 | GET {{host}}/readiness 6 | 7 | ### Simple string input - Ask about MCP Tools 8 | POST {{endpoint}} 9 | Content-Type: application/json 10 | { 11 | "input": "Please summarize the Azure AI Agent documentation related to MCP Tool calling?" 12 | } 13 | 14 | ### Explicit input - Ask about Agent Framework 15 | POST {{endpoint}} 16 | Content-Type: application/json 17 | { 18 | "input": [ 19 | { 20 | "type": "message", 21 | "role": "user", 22 | "content": [ 23 | { 24 | "type": "input_text", 25 | "text": "What is the Microsoft Agent Framework?" 26 | } 27 | ] 28 | } 29 | ] 30 | } 31 | -------------------------------------------------------------------------------- /samples/csharp/hosted-agents/AgentWithHostedMCP/AgentWithHostedMCP.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Exe 5 | net9.0 6 | 7 | enable 8 | enable 9 | 10 | $(NoWarn);MEAI001;OPENAI001 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /samples/typescript/quickstart/src/quickstart-create-agent.ts: -------------------------------------------------------------------------------- 1 | import { DefaultAzureCredential } from "@azure/identity"; 2 | import { AIProjectClient } from "@azure/ai-projects"; 3 | import "dotenv/config"; 4 | 5 | const projectEndpoint = process.env["PROJECT_ENDPOINT"] || ""; 6 | const deploymentName = process.env["MODEL_DEPLOYMENT_NAME"] || ""; 7 | 8 | async function main(): Promise { 9 | const project = new AIProjectClient(projectEndpoint, new DefaultAzureCredential()); 10 | const agent = await project.agents.createVersion("my-agent-basic", { 11 | kind: "prompt", 12 | model: deploymentName, 13 | instructions: "You are a helpful assistant that answers general questions", 14 | }); 15 | console.log(`Agent created (id: ${agent.id}, name: ${agent.name}, version: ${agent.version})`); 16 | } 17 | 18 | main().catch(console.error); -------------------------------------------------------------------------------- /infrastructure/infrastructure-setup-bicep/05-custom-policy-definitions/deny-non-foundry-resource-kinds.json: -------------------------------------------------------------------------------- 1 | { 2 | "properties": { 3 | "displayName": "Deny account kinds that do not support the full AI Foundry capabilities.", 4 | "policyType": "Custom", 5 | "mode": "All", 6 | "description": "This policy denies the creation of account kinds that do not support the full AI Foundry capabilities.", 7 | "version": "1.0.0", 8 | "parameters": {}, 9 | "policyRule": { 10 | "if": { 11 | "allOf": [ 12 | { 13 | "field": "type", 14 | "equals": "Microsoft.CognitiveServices/accounts" 15 | }, 16 | { 17 | "field": "kind", 18 | "notEquals": "AIServices" 19 | } 20 | ] 21 | }, 22 | "then": { 23 | "effect": "deny" 24 | } 25 | }, 26 | "versions": [ 27 | "1.0.0" 28 | ] 29 | } 30 | } -------------------------------------------------------------------------------- /samples-classic/csharp/getting-started-agents/AgentFramework/AgentWithHostedMCP/AgentWithHostedMCP.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Exe 5 | net9.0 6 | 7 | enable 8 | enable 9 | 10 | $(NoWarn);MEAI001;OPENAI001 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /samples/csharp/FoundryA365/infra/modules/botservice.bicep: -------------------------------------------------------------------------------- 1 | param botName string 2 | param displayName string 3 | param msaAppId string 4 | param endpoint string 5 | param botServiceSku string = 'F0' 6 | 7 | // Bot Service resource 8 | resource botService 'Microsoft.BotService/botServices@2022-09-15' = { 9 | name: botName 10 | kind: 'azurebot' 11 | location: 'global' 12 | sku: { 13 | name: botServiceSku 14 | } 15 | properties: { 16 | displayName: displayName 17 | endpoint: endpoint 18 | msaAppId: msaAppId 19 | msaAppTenantId: tenant().tenantId 20 | msaAppType: 'SingleTenant' 21 | } 22 | } 23 | 24 | // Connect the bot service to Microsoft Teams 25 | resource botServiceMsTeamsChannel 'Microsoft.BotService/botServices/channels@2021-03-01' = { 26 | parent: botService 27 | location: 'global' 28 | name: 'MsTeamsChannel' 29 | properties: { 30 | channelName: 'MsTeamsChannel' 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /samples/csharp/FoundryA365/src/hello_world_a365_agent/foundry-infra/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM mcr.microsoft.com/dotnet/aspnet:9.0 AS runtime 2 | WORKDIR /app 3 | 4 | ARG BLUEPRINT_CLIENT_ID 5 | ARG AUTHORITY_ENDPOINT 6 | ARG FEDERATED_CLIENT_ID 7 | ARG AZURE_OPENAI_ENDPOINT 8 | ARG MODEL_DEPLOYMENT 9 | 10 | COPY ./publish . 11 | 12 | # Expose the default port 13 | EXPOSE 8088 14 | 15 | ENV ASPNETCORE_URLS=http://+:8088 16 | 17 | ENV MCP_PLATFORM_ENDPOINT=https://agent365.svc.cloud.microsoft 18 | 19 | ENV Connections__ServiceConnection__Settings__ClientId=${BLUEPRINT_CLIENT_ID} 20 | ENV Connections__ServiceConnection__Settings__AuthorityEndpoint=${AUTHORITY_ENDPOINT} 21 | ENV Connections__ServiceConnection__Settings__FederatedClientId=${FEDERATED_CLIENT_ID} 22 | ENV AzureOpenAIEndpoint=${AZURE_OPENAI_ENDPOINT} 23 | ENV ModelDeployment=${MODEL_DEPLOYMENT} 24 | 25 | # Start the application 26 | ENTRYPOINT ["dotnet", "HelloWorldA365Agent.dll"] 27 | -------------------------------------------------------------------------------- /infrastructure/infrastructure-setup-terraform/15a-private-network-standard-agent-setup/code/variables.tf: -------------------------------------------------------------------------------- 1 | ## As of 6/2025 this is limited to RFC1918 Class B and Class C address space 2 | variable "virtual_network_address_space" { 3 | description = "The address space for the virtual network" 4 | type = string 5 | default = "192.168.0.0/16" 6 | } 7 | 8 | variable "agent_subnet_address_prefix" { 9 | description = "The address prefix for the subnet that will be delegated to the Standard Agent" 10 | type = string 11 | default = "192.168.0.0/24" 12 | } 13 | 14 | variable "private_endpoint_subnet_address_prefix" { 15 | description = "The address prefix for the subnet that contains the private endpoints" 16 | type = string 17 | default = "192.168.1.0/24" 18 | } 19 | 20 | variable "location" { 21 | description = "The name of the location to provision the resources to" 22 | type = string 23 | } 24 | -------------------------------------------------------------------------------- /samples/python/hosted-agents/code-interpreter-custom/requirements.txt: -------------------------------------------------------------------------------- 1 | aiohappyeyeballs==2.6.1 2 | aiohttp==3.13.2 3 | aiosignal==1.4.0 4 | annotated-types==0.7.0 5 | anyio==4.12.0 6 | attrs==25.4.0 7 | azure-ai-projects==2.0.0b2 8 | azure-core==1.36.0 9 | azure-identity==1.25.1 10 | azure-storage-blob==12.27.1 11 | certifi==2025.11.12 12 | cffi==2.0.0 13 | charset-normalizer==3.4.4 14 | cryptography==46.0.3 15 | distro==1.9.0 16 | dotenv==0.9.9 17 | frozenlist==1.8.0 18 | h11==0.16.0 19 | httpcore==1.0.9 20 | httpx==0.28.1 21 | idna==3.11 22 | isodate==0.7.2 23 | jiter==0.12.0 24 | msal==1.34.0 25 | msal-extensions==1.3.1 26 | multidict==6.7.0 27 | openai==2.8.1 28 | propcache==0.4.1 29 | pycparser==2.23 30 | pydantic==2.12.5 31 | pydantic_core==2.41.5 32 | PyJWT==2.10.1 33 | python-dotenv==1.2.1 34 | requests==2.32.5 35 | sniffio==1.3.1 36 | tqdm==4.67.1 37 | typing-inspection==0.4.2 38 | typing_extensions==4.15.0 39 | urllib3==2.5.0 40 | yarl==1.22.0 41 | -------------------------------------------------------------------------------- /samples-classic/javascript/quickstart/README.md: -------------------------------------------------------------------------------- 1 | # JavaScript QuickStart 2 | 3 | ## Set up your environment 4 | 5 | 1. [Install Node.js (LTS is recommended) and the Azure CLI](https://learn.microsoft.com/en-us/azure/ai-foundry/how-to/develop/install-cli-sdk). 6 | 7 | 1. Make sure to sign in using the CLI `az login` (or `az login --use-device-code`) command to authenticate before running the project. 8 | 9 | 1. Copy `.env.template` to `.env` and place it in the root of your project directory. 10 | 11 | 1. Open the `.env` file and fill in the following variables based upon your AI Foundry resource and project names: 12 | - `MODEL_DEPLOYMENT_NAME`: Your deployed Azure OpenAI model. Defaults to `gpt-4o`. 13 | - `PROJECT_ENDPOINT`: The endpoint for your AI Foundry project. 14 | 15 | 1. Install packages with `npm install`. 16 | 17 | ## Run a chat completion and agent 18 | 19 | Run `npm start` to start the application and trigger the chat completion and agents. 20 | -------------------------------------------------------------------------------- /.infra/deployment/modules/ai_project_deployment.bicep: -------------------------------------------------------------------------------- 1 | param name string 2 | param properties object 3 | param ai_services_name string 4 | 5 | var defaults = { 6 | raiPolicyName: 'Microsoft.Default' 7 | versionUpgradeOption: 'OnceNewDefaultVersionAvailable' 8 | type: 'Azure.OpenAI' 9 | sku: { 10 | name: 'Standard' 11 | capacity: 20 12 | } 13 | } 14 | 15 | var properties_with_defaults = union(defaults, properties) 16 | 17 | #disable-next-line BCP081 18 | resource aiResource 'Microsoft.CognitiveServices/accounts@2024-06-01-preview' existing = { 19 | name: ai_services_name 20 | 21 | } 22 | 23 | #disable-next-line BCP081 24 | resource deployment 'Microsoft.CognitiveServices/accounts/deployments@2024-06-01-preview' = { 25 | parent: aiResource 26 | name: name 27 | sku: properties_with_defaults.sku 28 | properties: { 29 | model: properties_with_defaults.model 30 | versionUpgradeOption: properties_with_defaults.versionUpgradeOption 31 | } 32 | } -------------------------------------------------------------------------------- /samples/csharp/hosted-agents/AgentsInWorkflows/agent.yaml: -------------------------------------------------------------------------------- 1 | name: AgentsInWorkflows 2 | displayName: "Translation Chain Workflow Agent" 3 | description: > 4 | A workflow agent that performs sequential translation through multiple languages. 5 | The agent translates text from English to French, then to Spanish, and finally back 6 | to English, leveraging AI-powered translation capabilities in a pipeline workflow. 7 | metadata: 8 | authors: 9 | - Microsoft Agent Framework Team 10 | tags: 11 | - Azure AI AgentServer 12 | - Microsoft Agent Framework 13 | - Workflows 14 | template: 15 | kind: hosted 16 | name: AgentsInWorkflows 17 | protocols: 18 | - protocol: responses 19 | version: v1 20 | environment_variables: 21 | - name: AZURE_OPENAI_ENDPOINT 22 | value: ${AZURE_OPENAI_ENDPOINT} 23 | - name: AZURE_OPENAI_DEPLOYMENT_NAME 24 | value: "{{chat}}" 25 | resources: 26 | - name: chat 27 | kind: model 28 | id: gpt-4o-mini 29 | -------------------------------------------------------------------------------- /samples/csharp/quickstart/quickstart-responses.cs: -------------------------------------------------------------------------------- 1 | using Azure.AI.Projects; 2 | using Azure.AI.Projects.OpenAI; 3 | using Azure.Identity; 4 | using OpenAI; 5 | using OpenAI.Responses; 6 | 7 | #pragma warning disable OPENAI001 8 | 9 | string projectEndpoint = Environment.GetEnvironmentVariable("PROJECT_ENDPOINT") 10 | ?? throw new InvalidOperationException("Missing environment variable 'PROJECT_ENDPOINT'"); 11 | string modelDeploymentName = Environment.GetEnvironmentVariable("MODEL_DEPLOYMENT_NAME") 12 | ?? throw new InvalidOperationException("Missing environment variable 'MODEL_DEPLOYMENT_NAME'"); 13 | 14 | AIProjectClient projectClient = new(new Uri(projectEndpoint ), new AzureCliCredential()); 15 | 16 | ProjectResponsesClient responseClient = projectClient.OpenAI.GetProjectResponsesClientForModel(modelDeploymentName); 17 | ResponseResult response = await responseClient.CreateResponseAsync("What is the size of France in square miles?"); 18 | 19 | Console.WriteLine(response.GetOutputText()); -------------------------------------------------------------------------------- /infrastructure/infrastructure-setup-bicep/02-storage-speech-language/modules/roleAssignment.bicep: -------------------------------------------------------------------------------- 1 | @description('Name of the Storage Account') 2 | param storageAccountName string 3 | 4 | @description('Principal ID of the AI Foundry managed identity') 5 | param principalId string 6 | 7 | @description('AI Foundry resource ID for generating unique role assignment name') 8 | param aiFoundryResourceId string 9 | 10 | resource storageAccount 'Microsoft.Storage/storageAccounts@2023-01-01' existing = { 11 | name: storageAccountName 12 | } 13 | 14 | resource roleAssignment 'Microsoft.Authorization/roleAssignments@2020-04-01-preview' = { 15 | name: guid(aiFoundryResourceId, 'Storage Blob Data Contributor') 16 | scope: storageAccount 17 | properties: { 18 | roleDefinitionId: subscriptionResourceId('Microsoft.Authorization/roleDefinitions', 'ba92f5b4-2d11-453d-a403-e96b0029c9fe') // Storage Blob Data Contributor 19 | principalId: principalId 20 | principalType: 'ServicePrincipal' 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /.github/copilot-instructions.md: -------------------------------------------------------------------------------- 1 | ## Files owned by the AI Platform Docs team 2 | 3 | If a file is listed in the CODEOWNERS file with @azure-ai-foundry/ai-platform-docs as the owner, it is owned by the AI Platform Docs team. For these files: 4 | 5 | - Do not change the filename or move the file. 6 | - Do not remove any comments which contain or (for any text in between the tags) 7 | - Do not remove any cell in a notebook if it contains metadata with "name:" in it. 8 | 9 | In a code review, if any of the above rules are broken, please add the following text to your review: 10 | 🛑STOP! This PR contains changes that may break documentation. Please post a message on [ai-platform-docs](https://teams.microsoft.com/l/team/19%3AHhf4F_YfPn3kYGdmWvePNwlbF5-RR8wciQEUwwrcggw1%40thread.tacv2/conversations?groupId=fdaf4412-8993-4ea6-a7d4-aeaded7fc854&tenantId=72f988bf-86f1-41af-91ab-2d7cd011db47) to request help. 11 | 12 | Only files owned by the AI Platform Docs team are subject to these rules. 13 | -------------------------------------------------------------------------------- /infrastructure/infrastructure-setup-bicep/41-standard-agent-setup/azuredeploy.parameters.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentParameters.json#", 3 | "contentVersion": "1.0.0.0", 4 | "parameters": { 5 | "location": { 6 | "value": "eastus" 7 | }, 8 | "aiServices": { 9 | "value": "aiservices" 10 | }, 11 | "firstProjectName": { 12 | "value": "project" 13 | }, 14 | "modelName": { 15 | "value": "gpt-4o" 16 | }, 17 | "modelFormat": { 18 | "value": "OpenAI" 19 | }, 20 | "modelVersion": { 21 | "value": "2024-11-20" 22 | }, 23 | "modelSkuName": { 24 | "value": "GlobalStandard" 25 | }, 26 | "modelCapacity": { 27 | "value": 1 28 | }, 29 | "aiSearchResourceId": { 30 | "value": "" 31 | }, 32 | "azureStorageAccountResourceId": { 33 | "value": "" 34 | }, 35 | "azureCosmosDBAccountResourceId": { 36 | "value": "" 37 | } 38 | } 39 | } -------------------------------------------------------------------------------- /samples-classic/csharp/getting-started-agents/AgentFramework/AgentsInWorkflows/agent.yaml: -------------------------------------------------------------------------------- 1 | name: AgentsInWorkflows 2 | displayName: "Translation Chain Workflow Agent" 3 | description: > 4 | A workflow agent that performs sequential translation through multiple languages. 5 | The agent translates text from English to French, then to Spanish, and finally back 6 | to English, leveraging AI-powered translation capabilities in a pipeline workflow. 7 | metadata: 8 | authors: 9 | - Microsoft Agent Framework Team 10 | tags: 11 | - Azure AI AgentServer 12 | - Microsoft Agent Framework 13 | - Workflows 14 | template: 15 | kind: hosted 16 | name: AgentsInWorkflows 17 | protocols: 18 | - protocol: responses 19 | version: v1 20 | environment_variables: 21 | - name: AZURE_OPENAI_ENDPOINT 22 | value: ${AZURE_OPENAI_ENDPOINT} 23 | - name: AZURE_OPENAI_DEPLOYMENT_NAME 24 | value: "{{chat}}" 25 | resources: 26 | - name: chat 27 | kind: model 28 | id: gpt-4o-mini 29 | -------------------------------------------------------------------------------- /samples/python/hosted-agents/agents_in_workflow/agent.yaml: -------------------------------------------------------------------------------- 1 | # Unique identifier/name for this agent 2 | name: agents-in-workflow 3 | # Brief description of what this agent does 4 | description: > 5 | A workflow agent that responds to product launch strategy inquiries by concurrently leveraging insights from three specialized agents. 6 | metadata: 7 | # Categorization tags for organizing and discovering agents 8 | authors: 9 | - Microsoft Agent Framework Team 10 | tags: 11 | - Azure AI AgentServer 12 | - Microsoft Agent Framework 13 | - Workflows 14 | template: 15 | name: agents-in-workflow 16 | # The type of agent - "hosted" for HOBO, "container" for COBO 17 | kind: hosted 18 | protocols: 19 | - protocol: responses 20 | environment_variables: 21 | - name: AZURE_OPENAI_ENDPOINT 22 | value: ${AZURE_OPENAI_ENDPOINT} 23 | - name: AZURE_OPENAI_CHAT_DEPLOYMENT_NAME 24 | value: "{{chat}}" 25 | resources: 26 | - kind: model 27 | id: gpt-4o-mini 28 | name: chat 29 | -------------------------------------------------------------------------------- /samples/python/hosted-agents/calculator-agent/agent.yaml: -------------------------------------------------------------------------------- 1 | name: CalculatorAgent 2 | description: This LangGraph agent can perform arithmetic calculations such as addition, subtraction, multiplication, and division. 3 | metadata: 4 | example: 5 | - role: user 6 | content: |- 7 | What is the size of France in square miles, divided by 27? 8 | tags: 9 | - example 10 | - learning 11 | authors: 12 | - migu 13 | template: 14 | name: CalculatorAgentLG 15 | kind: hosted 16 | protocols: 17 | - protocol: responses 18 | version: v1 19 | environment_variables: 20 | - name: AZURE_OPENAI_ENDPOINT 21 | value: ${AZURE_OPENAI_ENDPOINT} 22 | - name: OPENAI_API_VERSION 23 | value: 2025-03-01-preview 24 | - name: APPLICATIONINSIGHTS_CONNECTION_STRING 25 | value: ${APPLICATIONINSIGHTS_CONNECTION_STRING} 26 | - name: AZURE_AI_MODEL_DEPLOYMENT_NAME 27 | value: "{{chat}}" 28 | resources: 29 | - kind: model 30 | id: gpt-4o-mini 31 | name: chat 32 | -------------------------------------------------------------------------------- /samples-mistral/README.md: -------------------------------------------------------------------------------- 1 | # Mistral AI models on Azure Foundry 2 | 3 | This subdirectory contains code samples to get started with Mistral AI models on 4 | the Azure Foundry platform. 5 | 6 | ## Getting started 7 | 8 | The recommended way to set up your environment is to leverage [uv](). Otherwise you 9 | can rely on the auto-generated `requirements.txt` file with the package manager of 10 | your choice (e.g. pip, poetry, etc.) 11 | 12 | To install the required dependencies and start a notebook server, run the following 13 | commands in your terminal: 14 | 15 | ```bash 16 | uv sync # Installs/updates the required dependencies 17 | uv run jupyter notebook # Starts a notebook server 18 | ``` 19 | 20 | From there you can open the Jupyter notebook UI in your web browser following the URL 21 | that the previous command will output. 22 | 23 | You can also run the notebooks from Visual Studio Code, please refer to the 24 | [VSCode documentation](https://code.visualstudio.com/docs/datascience/jupyter-notebooks) 25 | for more details. 26 | -------------------------------------------------------------------------------- /samples/python/hosted-agents/web-search-agent/agent.yaml: -------------------------------------------------------------------------------- 1 | name: WebSearchAgent 2 | description: This Agent can perform web searches and retrieve the latest information from Bing. 3 | metadata: 4 | example: 5 | - role: user 6 | content: |- 7 | What's the latest news in AI? 8 | tags: 9 | - AI Agent Grounding 10 | - AI Agent Hosting 11 | - Azure AI AgentServer 12 | - Bing Grounding 13 | - Microsoft Agent Framework 14 | authors: 15 | - jeomhove 16 | template: 17 | name: WebSearchAgent 18 | kind: hosted 19 | protocols: 20 | - protocol: responses 21 | version: v1 22 | environment_variables: 23 | - name: AZURE_AI_PROJECT_ENDPOINT 24 | value: ${AZURE_AI_PROJECT_ENDPOINT} 25 | - name: BING_GROUNDING_CONNECTION_ID 26 | value: ${BING_GROUNDING_CONNECTION_ID} 27 | - name: AZURE_AI_MODEL_DEPLOYMENT_NAME 28 | value: "{{chat}}" 29 | resources: 30 | - kind: model 31 | id: gpt-4o-mini 32 | name: chat 33 | - kind: tool 34 | id: bing_grounding 35 | -------------------------------------------------------------------------------- /infrastructure/infrastructure-setup-bicep/31-customer-managed-keys-standard-agent/deployment.parameters.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentParameters.json#", 3 | "contentVersion": "1.0.0.0", 4 | "parameters": { 5 | "location": { 6 | "value": "" 7 | }, 8 | "aiFoundryName": { 9 | "value": "" 10 | }, 11 | "projectName": { 12 | "value": "" 13 | }, 14 | "aiSearchResourceId": { 15 | "value": "" 16 | }, 17 | "azureStorageAccountResourceId": { 18 | "value": "" 19 | }, 20 | "azureCosmosDBAccountResourceId": { 21 | "value": "" 22 | }, 23 | "projectCapHost": { 24 | "value": "projcaphost" 25 | }, 26 | "accountCapHost": { 27 | "value": "caphostacc" 28 | }, 29 | "keyVaultName": { 30 | "value": "yourkeyvaultname" 31 | }, 32 | "keyName": { 33 | "value": "yourkeyvaultkey" 34 | }, 35 | "keyVersion": { 36 | "value": "yourkeyversion" 37 | } 38 | } 39 | } -------------------------------------------------------------------------------- /infrastructure/infrastructure-setup-bicep/43-standard-agent-setup-with-customization/modules-standard/ai-account-identity.bicep: -------------------------------------------------------------------------------- 1 | 2 | param accountName string 3 | param location string 4 | 5 | resource account 'Microsoft.CognitiveServices/accounts@2025-04-01-preview' = { 6 | name: accountName 7 | location: location 8 | sku: { 9 | name: 'S0' 10 | } 11 | kind: 'AIServices' 12 | identity: { 13 | type: 'SystemAssigned' 14 | } 15 | properties: { 16 | allowProjectManagement: true 17 | customSubDomainName: accountName 18 | networkAcls: { 19 | defaultAction: 'Allow' 20 | virtualNetworkRules: [] 21 | ipRules: [] 22 | } 23 | publicNetworkAccess: 'Enabled' 24 | 25 | // API-key based auth is not supported for the Agent service 26 | disableLocalAuth: false 27 | } 28 | } 29 | 30 | output accountName string = account.name 31 | output accountID string = account.id 32 | output accountTarget string = account.properties.endpoint 33 | output accountPrincipalId string = account.identity.principalId 34 | -------------------------------------------------------------------------------- /infrastructure/infrastructure-setup-bicep/45-basic-agent-bing/modules/ai-project-keys.bicep: -------------------------------------------------------------------------------- 1 | 2 | param account_name string 3 | param location string 4 | param project_name string 5 | param description string 6 | param display_name string 7 | 8 | #disable-next-line BCP081 9 | resource account_name_resource 'Microsoft.CognitiveServices/accounts@2025-04-01-preview' existing = { 10 | name: account_name 11 | scope: resourceGroup() 12 | } 13 | 14 | #disable-next-line BCP081 15 | resource account_name_project_name 'Microsoft.CognitiveServices/accounts/projects@2025-04-01-preview' = { 16 | parent: account_name_resource 17 | name: project_name 18 | location: location 19 | identity: { 20 | type: 'SystemAssigned' 21 | } 22 | properties: { 23 | description: description 24 | displayName: display_name 25 | } 26 | } 27 | 28 | output project_name string = account_name_project_name.name 29 | output project_id string = account_name_project_name.id 30 | output projectPrincipalId string = account_name_project_name.identity.principalId 31 | -------------------------------------------------------------------------------- /samples-classic/python/getting-started-agents/agent-framework/agents_in_workflow/agent.yaml: -------------------------------------------------------------------------------- 1 | # Unique identifier/name for this agent 2 | name: agents-in-workflow 3 | # Brief description of what this agent does 4 | description: > 5 | A workflow agent that responds to product launch strategy inquiries by concurrently leveraging insights from three specialized agents. 6 | metadata: 7 | # Categorization tags for organizing and discovering agents 8 | authors: 9 | - Microsoft Agent Framework Team 10 | tags: 11 | - Azure AI AgentServer 12 | - Microsoft Agent Framework 13 | - Workflows 14 | template: 15 | name: agents-in-workflow 16 | # The type of agent - "hosted" for HOBO, "container" for COBO 17 | kind: hosted 18 | protocols: 19 | - protocol: responses 20 | environment_variables: 21 | - name: AZURE_OPENAI_ENDPOINT 22 | value: ${AZURE_OPENAI_ENDPOINT} 23 | - name: AZURE_OPENAI_CHAT_DEPLOYMENT_NAME 24 | value: "{{chat}}" 25 | resources: 26 | - kind: model 27 | id: gpt-4o-mini 28 | name: chat 29 | -------------------------------------------------------------------------------- /samples-classic/python/getting-started-agents/hosted-agents/calculator-agent/agent.yaml: -------------------------------------------------------------------------------- 1 | name: CalculatorAgent 2 | description: This LangGraph agent can perform arithmetic calculations such as addition, subtraction, multiplication, and division. 3 | metadata: 4 | example: 5 | - role: user 6 | content: |- 7 | What is the size of France in square miles, divided by 27? 8 | tags: 9 | - example 10 | - learning 11 | authors: 12 | - migu 13 | template: 14 | name: CalculatorAgentLG 15 | kind: hosted 16 | protocols: 17 | - protocol: responses 18 | version: v1 19 | environment_variables: 20 | - name: AZURE_OPENAI_ENDPOINT 21 | value: ${AZURE_OPENAI_ENDPOINT} 22 | - name: OPENAI_API_VERSION 23 | value: 2025-03-01-preview 24 | - name: APPLICATIONINSIGHTS_CONNECTION_STRING 25 | value: ${APPLICATIONINSIGHTS_CONNECTION_STRING} 26 | - name: AZURE_AI_MODEL_DEPLOYMENT_NAME 27 | value: "{{chat}}" 28 | resources: 29 | - kind: model 30 | id: gpt-4o-mini 31 | name: chat 32 | -------------------------------------------------------------------------------- /infrastructure/infrastructure-setup-bicep/00-basic/README.md: -------------------------------------------------------------------------------- 1 | --- 2 | description: This template deploys an Azure AI Foundry project. 3 | page_type: sample 4 | products: 5 | - azure 6 | - azure-resource-manager 7 | urlFragment: aifoundry-basic-project 8 | languages: 9 | - bicep 10 | - json 11 | --- 12 | # Deploy an Azure AI Foundry project 13 | 14 | This Azure AI Foundry template is built on Azure Cognitive Services as a resource provider. This template deploys an Azure AI Foundry resource and project. This allows you to access AI Foundry capabilities like Agents, Evaluations, Tracing, etc. 15 | 16 | If you are new to Azure AI Foundry, see: 17 | 18 | - [Azure AI Foundry](https://learn.microsoft.com/azure/ai-foundry/) 19 | 20 | If you are new to template deployment, see: 21 | 22 | - [Azure Resource Manager documentation](https://learn.microsoft.com/azure/azure-resource-manager/) 23 | - [Azure AI services quickstart article](https://learn.microsoft.com/azure/cognitive-services/resource-manager-template) 24 | 25 | `Tags: Microsoft.CognitiveServices/accounts/projects` -------------------------------------------------------------------------------- /samples-classic/python/getting-started-agents/hosted-agents/web-search-agent/agent.yaml: -------------------------------------------------------------------------------- 1 | name: WebSearchAgent 2 | description: This Agent can perform web searches and retrieve the latest information from Bing. 3 | metadata: 4 | example: 5 | - role: user 6 | content: |- 7 | What's the latest news in AI? 8 | tags: 9 | - AI Agent Grounding 10 | - AI Agent Hosting 11 | - Azure AI AgentServer 12 | - Bing Grounding 13 | - Microsoft Agent Framework 14 | authors: 15 | - jeomhove 16 | template: 17 | name: WebSearchAgent 18 | kind: hosted 19 | protocols: 20 | - protocol: responses 21 | version: v1 22 | environment_variables: 23 | - name: AZURE_AI_PROJECT_ENDPOINT 24 | value: ${AZURE_AI_PROJECT_ENDPOINT} 25 | - name: BING_GROUNDING_CONNECTION_ID 26 | value: ${BING_GROUNDING_CONNECTION_ID} 27 | - name: AZURE_AI_MODEL_DEPLOYMENT_NAME 28 | value: "{{chat}}" 29 | resources: 30 | - kind: model 31 | id: gpt-4o-mini 32 | name: chat 33 | - kind: tool 34 | id: bing_grounding 35 | -------------------------------------------------------------------------------- /samples/typescript/quickstart/src/quickstart-chat-with-agent.ts: -------------------------------------------------------------------------------- 1 | import { DefaultAzureCredential } from "@azure/identity"; 2 | import { AIProjectClient } from "@azure/ai-projects"; 3 | import "dotenv/config"; 4 | 5 | const projectEndpoint = process.env["PROJECT_ENDPOINT"] || ""; 6 | const deploymentName = process.env["MODEL_DEPLOYMENT_NAME"] || ""; 7 | 8 | async function main(): Promise { 9 | const project = new AIProjectClient(projectEndpoint, new DefaultAzureCredential()); 10 | const openAIClient = await project.getOpenAIClient(); 11 | const response = await openAIClient.responses.create({ 12 | model: deploymentName, 13 | input: "What is the size of France in square miles?", 14 | }); 15 | const response2 = await openAIClient.responses.create({ 16 | model: deploymentName, 17 | input: "And what is the capital city?", 18 | previous_response_id: response.id, 19 | }); 20 | console.log(`Response output: ${response2.output_text}`); 21 | }; 22 | 23 | main().catch(console.error); -------------------------------------------------------------------------------- /infrastructure/infrastructure-setup-bicep/41-standard-agent-setup/modules-standard/azure-storage-account-role-assignment.bicep: -------------------------------------------------------------------------------- 1 | param azureStorageName string 2 | param projectPrincipalId string 3 | 4 | resource storageAccount 'Microsoft.Storage/storageAccounts@2023-05-01' existing = { 5 | name: azureStorageName 6 | scope: resourceGroup() 7 | } 8 | 9 | // Blob Storage Owner: b7e6dc6d-f1e8-4753-8033-0f276bb0955b 10 | // Blob Storage Contributor: ba92f5b4-2d11-453d-a403-e96b0029c9fe 11 | resource storageBlobDataContributor 'Microsoft.Authorization/roleDefinitions@2022-05-01-preview' existing = { 12 | name: 'ba92f5b4-2d11-453d-a403-e96b0029c9fe' 13 | scope: resourceGroup() 14 | } 15 | 16 | resource storageBlobDataContributorRoleAssignmentProject 'Microsoft.Authorization/roleAssignments@2022-04-01' = { 17 | scope: storageAccount 18 | name: guid(projectPrincipalId, storageBlobDataContributor.id, storageAccount.id) 19 | properties: { 20 | principalId: projectPrincipalId 21 | roleDefinitionId: storageBlobDataContributor.id 22 | principalType: 'ServicePrincipal' 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /samples-classic/python/getting-started-agents/agent-framework/agent_with_hosted_mcp/main.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) Microsoft. All rights reserved. 2 | 3 | from agent_framework import HostedMCPTool 4 | from agent_framework.azure import AzureOpenAIChatClient 5 | from azure.ai.agentserver.agentframework import from_agent_framework # pyright: ignore[reportUnknownVariableType] 6 | from azure.identity import DefaultAzureCredential 7 | 8 | 9 | def main(): 10 | # Create an Agent using the Azure OpenAI Chat Client with a MCP Tool that connects to Microsoft Learn MCP 11 | agent = AzureOpenAIChatClient(credential=DefaultAzureCredential()).create_agent( 12 | name="DocsAgent", 13 | instructions="You are a helpful assistant that can help with microsoft documentation questions.", 14 | tools=HostedMCPTool( 15 | name="Microsoft Learn MCP", 16 | url="https://learn.microsoft.com/api/mcp", 17 | ), 18 | ) 19 | 20 | # Run the agent as a hosted agent 21 | from_agent_framework(agent).run() 22 | 23 | 24 | if __name__ == "__main__": 25 | main() 26 | -------------------------------------------------------------------------------- /samples/python/hosted-agents/agent_with_hosted_mcp/agent.yaml: -------------------------------------------------------------------------------- 1 | # Unique identifier/name for this agent 2 | name: agent-with-hosted-mcp 3 | # Brief description of what this agent does 4 | description: > 5 | An AI agent that uses Azure OpenAI with a Hosted Model Context Protocol (MCP) server. 6 | The agent answers questions by searching Microsoft Learn documentation using MCP tools. 7 | metadata: 8 | # Categorization tags for organizing and discovering agents 9 | authors: 10 | - Microsoft Agent Framework Team 11 | tags: 12 | - Azure AI AgentServer 13 | - Microsoft Agent Framework 14 | - Model Context Protocol 15 | - MCP 16 | template: 17 | name: agent-with-hosted-mcp 18 | # The type of agent - "hosted" for HOBO, "container" for COBO 19 | kind: hosted 20 | protocols: 21 | - protocol: responses 22 | environment_variables: 23 | - name: AZURE_OPENAI_ENDPOINT 24 | value: ${AZURE_OPENAI_ENDPOINT} 25 | - name: AZURE_OPENAI_CHAT_DEPLOYMENT_NAME 26 | value: "{{chat}}" 27 | resources: 28 | - kind: model 29 | id: gpt-4o-mini 30 | name: chat 31 | -------------------------------------------------------------------------------- /infrastructure/infrastructure-setup-bicep/41-standard-agent-setup/modules-standard/cosmosdb-account-role-assignment.bicep: -------------------------------------------------------------------------------- 1 | // Assigns Role Cosmos DB Operator to the Project Principal ID 2 | @description('Name of the AI Search resource') 3 | param cosmosDBName string 4 | 5 | @description('Principal ID of the AI project') 6 | param projectPrincipalId string 7 | 8 | 9 | resource cosmosDBAccount 'Microsoft.DocumentDB/databaseAccounts@2024-12-01-preview' existing = { 10 | name: cosmosDBName 11 | scope: resourceGroup() 12 | } 13 | 14 | resource cosmosDBOperatorRole 'Microsoft.Authorization/roleDefinitions@2022-04-01' existing = { 15 | name: '230815da-be43-4aae-9cb4-875f7bd000aa' 16 | scope: resourceGroup() 17 | } 18 | 19 | resource cosmosDBOperatorRoleAssignment 'Microsoft.Authorization/roleAssignments@2022-04-01' = { 20 | scope: cosmosDBAccount 21 | name: guid(projectPrincipalId, cosmosDBOperatorRole.id, cosmosDBAccount.id) 22 | properties: { 23 | principalId: projectPrincipalId 24 | roleDefinitionId: cosmosDBOperatorRole.id 25 | principalType: 'ServicePrincipal' 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /infrastructure/infrastructure-setup-bicep/31-customer-managed-keys-standard-agent/modules-standard/azure-storage-account-role-assignment.bicep: -------------------------------------------------------------------------------- 1 | param azureStorageName string 2 | param projectPrincipalId string 3 | 4 | resource storageAccount 'Microsoft.Storage/storageAccounts@2023-05-01' existing = { 5 | name: azureStorageName 6 | scope: resourceGroup() 7 | } 8 | 9 | // Blob Storage Owner: b7e6dc6d-f1e8-4753-8033-0f276bb0955b 10 | // Blob Storage Contributor: ba92f5b4-2d11-453d-a403-e96b0029c9fe 11 | resource storageBlobDataContributor 'Microsoft.Authorization/roleDefinitions@2022-05-01-preview' existing = { 12 | name: 'ba92f5b4-2d11-453d-a403-e96b0029c9fe' 13 | scope: resourceGroup() 14 | } 15 | 16 | resource storageBlobDataContributorRoleAssignmentProject 'Microsoft.Authorization/roleAssignments@2022-04-01' = { 17 | scope: storageAccount 18 | name: guid(projectPrincipalId, storageBlobDataContributor.id, storageAccount.id) 19 | properties: { 20 | principalId: projectPrincipalId 21 | roleDefinitionId: storageBlobDataContributor.id 22 | principalType: 'ServicePrincipal' 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /infrastructure/infrastructure-setup-bicep/18-managed-virtual-network-preview/modules-network-secured/azure-storage-account-role-assignment.bicep: -------------------------------------------------------------------------------- 1 | param azureStorageName string 2 | param projectPrincipalId string 3 | 4 | resource storageAccount 'Microsoft.Storage/storageAccounts@2023-05-01' existing = { 5 | name: azureStorageName 6 | scope: resourceGroup() 7 | } 8 | 9 | // Blob Storage Owner: b7e6dc6d-f1e8-4753-8033-0f276bb0955b 10 | // Blob Storage Contributor: ba92f5b4-2d11-453d-a403-e96b0029c9fe 11 | resource storageBlobDataContributor 'Microsoft.Authorization/roleDefinitions@2022-05-01-preview' existing = { 12 | name: 'ba92f5b4-2d11-453d-a403-e96b0029c9fe' 13 | scope: resourceGroup() 14 | } 15 | 16 | resource storageBlobDataContributorRoleAssignmentProject 'Microsoft.Authorization/roleAssignments@2022-04-01' = { 17 | scope: storageAccount 18 | name: guid(projectPrincipalId, storageBlobDataContributor.id, storageAccount.id) 19 | properties: { 20 | principalId: projectPrincipalId 21 | roleDefinitionId: storageBlobDataContributor.id 22 | principalType: 'ServicePrincipal' 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /infrastructure/infrastructure-setup-bicep/31-customer-managed-keys-standard-agent/modules-standard/cosmosdb-account-role-assignment.bicep: -------------------------------------------------------------------------------- 1 | // Assigns Role Cosmos DB Operator to the Project Principal ID 2 | @description('Name of the AI Search resource') 3 | param cosmosDBName string 4 | 5 | @description('Principal ID of the AI project') 6 | param projectPrincipalId string 7 | 8 | resource cosmosDBAccount 'Microsoft.DocumentDB/databaseAccounts@2024-12-01-preview' existing = { 9 | name: cosmosDBName 10 | scope: resourceGroup() 11 | } 12 | 13 | resource cosmosDBOperatorRole 'Microsoft.Authorization/roleDefinitions@2022-04-01' existing = { 14 | name: '230815da-be43-4aae-9cb4-875f7bd000aa' 15 | scope: resourceGroup() 16 | } 17 | 18 | resource cosmosDBOperatorRoleAssignment 'Microsoft.Authorization/roleAssignments@2022-04-01' = { 19 | scope: cosmosDBAccount 20 | name: guid(projectPrincipalId, cosmosDBOperatorRole.id, cosmosDBAccount.id) 21 | properties: { 22 | principalId: projectPrincipalId 23 | roleDefinitionId: cosmosDBOperatorRole.id 24 | principalType: 'ServicePrincipal' 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /infrastructure/infrastructure-setup-bicep/43-standard-agent-setup-with-customization/modules-standard/azure-storage-account-role-assignment.bicep: -------------------------------------------------------------------------------- 1 | param azureStorageName string 2 | param projectPrincipalId string 3 | 4 | resource storageAccount 'Microsoft.Storage/storageAccounts@2023-05-01' existing = { 5 | name: azureStorageName 6 | scope: resourceGroup() 7 | } 8 | 9 | // Blob Storage Owner: b7e6dc6d-f1e8-4753-8033-0f276bb0955b 10 | // Blob Storage Contributor: ba92f5b4-2d11-453d-a403-e96b0029c9fe 11 | resource storageBlobDataContributor 'Microsoft.Authorization/roleDefinitions@2022-05-01-preview' existing = { 12 | name: 'ba92f5b4-2d11-453d-a403-e96b0029c9fe' 13 | scope: resourceGroup() 14 | } 15 | 16 | resource storageBlobDataContributorRoleAssignmentProject 'Microsoft.Authorization/roleAssignments@2022-04-01' = { 17 | scope: storageAccount 18 | name: guid(projectPrincipalId, storageBlobDataContributor.id, storageAccount.id) 19 | properties: { 20 | principalId: projectPrincipalId 21 | roleDefinitionId: storageBlobDataContributor.id 22 | principalType: 'ServicePrincipal' 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /infrastructure/infrastructure-setup-bicep/15-private-network-standard-agent-setup/modules-network-secured/azure-storage-account-role-assignment.bicep: -------------------------------------------------------------------------------- 1 | param azureStorageName string 2 | param projectPrincipalId string 3 | 4 | resource storageAccount 'Microsoft.Storage/storageAccounts@2023-05-01' existing = { 5 | name: azureStorageName 6 | scope: resourceGroup() 7 | } 8 | 9 | // Blob Storage Owner: b7e6dc6d-f1e8-4753-8033-0f276bb0955b 10 | // Blob Storage Contributor: ba92f5b4-2d11-453d-a403-e96b0029c9fe 11 | resource storageBlobDataContributor 'Microsoft.Authorization/roleDefinitions@2022-05-01-preview' existing = { 12 | name: 'ba92f5b4-2d11-453d-a403-e96b0029c9fe' 13 | scope: resourceGroup() 14 | } 15 | 16 | resource storageBlobDataContributorRoleAssignmentProject 'Microsoft.Authorization/roleAssignments@2022-04-01' = { 17 | scope: storageAccount 18 | name: guid(projectPrincipalId, storageBlobDataContributor.id, storageAccount.id) 19 | properties: { 20 | principalId: projectPrincipalId 21 | roleDefinitionId: storageBlobDataContributor.id 22 | principalType: 'ServicePrincipal' 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /infrastructure/infrastructure-setup-bicep/18-managed-virtual-network-preview/modules-network-secured/cosmosdb-account-role-assignment.bicep: -------------------------------------------------------------------------------- 1 | // Assigns Role Cosmos DB Operator to the Project Principal ID 2 | @description('Name of the AI Search resource') 3 | param cosmosDBName string 4 | 5 | @description('Principal ID of the AI project') 6 | param projectPrincipalId string 7 | 8 | 9 | resource cosmosDBAccount 'Microsoft.DocumentDB/databaseAccounts@2024-12-01-preview' existing = { 10 | name: cosmosDBName 11 | scope: resourceGroup() 12 | } 13 | 14 | resource cosmosDBOperatorRole 'Microsoft.Authorization/roleDefinitions@2022-04-01' existing = { 15 | name: '230815da-be43-4aae-9cb4-875f7bd000aa' 16 | scope: resourceGroup() 17 | } 18 | 19 | resource cosmosDBOperatorRoleAssignment 'Microsoft.Authorization/roleAssignments@2022-04-01' = { 20 | scope: cosmosDBAccount 21 | name: guid(projectPrincipalId, cosmosDBOperatorRole.id, cosmosDBAccount.id) 22 | properties: { 23 | principalId: projectPrincipalId 24 | roleDefinitionId: cosmosDBOperatorRole.id 25 | principalType: 'ServicePrincipal' 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /infrastructure/infrastructure-setup-bicep/43-standard-agent-setup-with-customization/modules-standard/cosmosdb-account-role-assignment.bicep: -------------------------------------------------------------------------------- 1 | // Assigns Role Cosmos DB Operator to the Project Principal ID 2 | @description('Name of the AI Search resource') 3 | param cosmosDBName string 4 | 5 | @description('Principal ID of the AI project') 6 | param projectPrincipalId string 7 | 8 | 9 | resource cosmosDBAccount 'Microsoft.DocumentDB/databaseAccounts@2024-12-01-preview' existing = { 10 | name: cosmosDBName 11 | scope: resourceGroup() 12 | } 13 | 14 | resource cosmosDBOperatorRole 'Microsoft.Authorization/roleDefinitions@2022-04-01' existing = { 15 | name: '230815da-be43-4aae-9cb4-875f7bd000aa' 16 | scope: resourceGroup() 17 | } 18 | 19 | resource cosmosDBOperatorRoleAssignment 'Microsoft.Authorization/roleAssignments@2022-04-01' = { 20 | scope: cosmosDBAccount 21 | name: guid(projectPrincipalId, cosmosDBOperatorRole.id, cosmosDBAccount.id) 22 | properties: { 23 | principalId: projectPrincipalId 24 | roleDefinitionId: cosmosDBOperatorRole.id 25 | principalType: 'ServicePrincipal' 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /samples/csharp/hosted-agents/AgentWithHostedMCP/agent.yaml: -------------------------------------------------------------------------------- 1 | name: AgentWithHostedMCP 2 | displayName: "Microsoft Learn Response Agent with MCP" 3 | description: > 4 | An AI agent that uses Azure OpenAI Responses with a Hosted Model Context Protocol (MCP) server. 5 | The agent answers questions by searching Microsoft Learn documentation using MCP tools. 6 | This demonstrates how MCP tools can be integrated with Azure OpenAI Responses where the service 7 | itself handles tool invocation. 8 | metadata: 9 | authors: 10 | - Microsoft Agent Framework Team 11 | tags: 12 | - Azure AI AgentServer 13 | - Microsoft Agent Framework 14 | - Model Context Protocol 15 | - MCP 16 | - Tool Call Approval 17 | template: 18 | kind: hosted 19 | name: AgentWithHostedMCP 20 | protocols: 21 | - protocol: responses 22 | version: v1 23 | environment_variables: 24 | - name: AZURE_OPENAI_ENDPOINT 25 | value: ${AZURE_OPENAI_ENDPOINT} 26 | - name: AZURE_OPENAI_DEPLOYMENT_NAME 27 | value: "{{chat}}" 28 | resources: 29 | - name: chat 30 | kind: model 31 | id: gpt-4o-mini 32 | -------------------------------------------------------------------------------- /infrastructure/infrastructure-setup-bicep/15-private-network-standard-agent-setup/modules-network-secured/cosmosdb-account-role-assignment.bicep: -------------------------------------------------------------------------------- 1 | // Assigns Role Cosmos DB Operator to the Project Principal ID 2 | @description('Name of the Cosmos DB resource') 3 | param cosmosDBName string 4 | 5 | @description('Principal ID of the AI project') 6 | param projectPrincipalId string 7 | 8 | 9 | resource cosmosDBAccount 'Microsoft.DocumentDB/databaseAccounts@2024-12-01-preview' existing = { 10 | name: cosmosDBName 11 | scope: resourceGroup() 12 | } 13 | 14 | resource cosmosDBOperatorRole 'Microsoft.Authorization/roleDefinitions@2022-04-01' existing = { 15 | name: '230815da-be43-4aae-9cb4-875f7bd000aa' 16 | scope: resourceGroup() 17 | } 18 | 19 | resource cosmosDBOperatorRoleAssignment 'Microsoft.Authorization/roleAssignments@2022-04-01' = { 20 | scope: cosmosDBAccount 21 | name: guid(projectPrincipalId, cosmosDBOperatorRole.id, cosmosDBAccount.id) 22 | properties: { 23 | principalId: projectPrincipalId 24 | roleDefinitionId: cosmosDBOperatorRole.id 25 | principalType: 'ServicePrincipal' 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /samples/csharp/FoundryA365/src/hello_world_a365_agent/Models/PresenceState.cs: -------------------------------------------------------------------------------- 1 | namespace HelloWorldA365.Models; 2 | 3 | public enum Availability 4 | { 5 | Available, 6 | Busy, 7 | Away, 8 | DoNotDisturb 9 | } 10 | 11 | public enum PresenceActivity 12 | { 13 | Available, 14 | InACall, 15 | InAConferenceCall, 16 | Away, 17 | Presenting 18 | } 19 | 20 | public sealed record PresenceState( 21 | Availability Availability, 22 | PresenceActivity Activity) 23 | { 24 | public static PresenceState Available => 25 | new(Availability.Available, PresenceActivity.Available); 26 | 27 | public static PresenceState BusyInCall => 28 | new(Availability.Busy, PresenceActivity.InACall); 29 | 30 | public static PresenceState BusyInConferenceCall => 31 | new(Availability.Busy, PresenceActivity.InAConferenceCall); 32 | 33 | public static PresenceState Away => 34 | new(Availability.Away, PresenceActivity.Away); 35 | 36 | public static PresenceState DoNotDisturbPresenting => 37 | new(Availability.DoNotDisturb, PresenceActivity.Presenting); 38 | } -------------------------------------------------------------------------------- /infrastructure/infrastructure-setup-bicep/16-private-network-standard-agent-apim-setup-preview/modules-network-secured/azure-storage-account-role-assignment.bicep: -------------------------------------------------------------------------------- 1 | param azureStorageName string 2 | param projectPrincipalId string 3 | 4 | resource storageAccount 'Microsoft.Storage/storageAccounts@2023-05-01' existing = { 5 | name: azureStorageName 6 | scope: resourceGroup() 7 | } 8 | 9 | // Blob Storage Owner: b7e6dc6d-f1e8-4753-8033-0f276bb0955b 10 | // Blob Storage Contributor: ba92f5b4-2d11-453d-a403-e96b0029c9fe 11 | resource storageBlobDataContributor 'Microsoft.Authorization/roleDefinitions@2022-05-01-preview' existing = { 12 | name: 'ba92f5b4-2d11-453d-a403-e96b0029c9fe' 13 | scope: resourceGroup() 14 | } 15 | 16 | resource storageBlobDataContributorRoleAssignmentProject 'Microsoft.Authorization/roleAssignments@2022-04-01' = { 17 | scope: storageAccount 18 | name: guid(projectPrincipalId, storageBlobDataContributor.id, storageAccount.id) 19 | properties: { 20 | principalId: projectPrincipalId 21 | roleDefinitionId: storageBlobDataContributor.id 22 | principalType: 'ServicePrincipal' 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /samples-classic/python/getting-started-agents/agent-framework/agent_with_hosted_mcp/agent.yaml: -------------------------------------------------------------------------------- 1 | # Unique identifier/name for this agent 2 | name: agent-with-hosted-mcp 3 | # Brief description of what this agent does 4 | description: > 5 | An AI agent that uses Azure OpenAI with a Hosted Model Context Protocol (MCP) server. 6 | The agent answers questions by searching Microsoft Learn documentation using MCP tools. 7 | metadata: 8 | # Categorization tags for organizing and discovering agents 9 | authors: 10 | - Microsoft Agent Framework Team 11 | tags: 12 | - Azure AI AgentServer 13 | - Microsoft Agent Framework 14 | - Model Context Protocol 15 | - MCP 16 | template: 17 | name: agent-with-hosted-mcp 18 | # The type of agent - "hosted" for HOBO, "container" for COBO 19 | kind: hosted 20 | protocols: 21 | - protocol: responses 22 | environment_variables: 23 | - name: AZURE_OPENAI_ENDPOINT 24 | value: ${AZURE_OPENAI_ENDPOINT} 25 | - name: AZURE_OPENAI_CHAT_DEPLOYMENT_NAME 26 | value: "{{chat}}" 27 | resources: 28 | - kind: model 29 | id: gpt-4o-mini 30 | name: chat 31 | -------------------------------------------------------------------------------- /samples/python/hosted-agents/agent_with_hosted_mcp/main.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) Microsoft. All rights reserved. 2 | 3 | from agent_framework import HostedMCPTool 4 | from agent_framework.azure import AzureOpenAIChatClient 5 | from azure.ai.agentserver.agentframework import from_agent_framework # pyright: ignore[reportUnknownVariableType] 6 | from azure.identity import DefaultAzureCredential 7 | 8 | 9 | def create_agent(): 10 | # Create an Agent using the Azure OpenAI Chat Client with a MCP Tool that connects to Microsoft Learn MCP 11 | agent = AzureOpenAIChatClient(credential=DefaultAzureCredential()).create_agent( 12 | name="DocsAgent", 13 | instructions="You are a helpful assistant that can help with microsoft documentation questions.", 14 | tools=HostedMCPTool( 15 | name="Microsoft Learn MCP", 16 | url="https://learn.microsoft.com/api/mcp", 17 | ), 18 | ) 19 | return agent 20 | 21 | 22 | def main(): 23 | # Run the agent as a hosted agent 24 | from_agent_framework(lambda _: create_agent()).run() 25 | 26 | 27 | if __name__ == "__main__": 28 | main() 29 | -------------------------------------------------------------------------------- /infrastructure/infrastructure-setup-bicep/16-private-network-standard-agent-apim-setup-preview/modules-network-secured/cosmosdb-account-role-assignment.bicep: -------------------------------------------------------------------------------- 1 | // Assigns Role Cosmos DB Operator to the Project Principal ID 2 | @description('Name of the AI Search resource') 3 | param cosmosDBName string 4 | 5 | @description('Principal ID of the AI project') 6 | param projectPrincipalId string 7 | 8 | 9 | resource cosmosDBAccount 'Microsoft.DocumentDB/databaseAccounts@2024-12-01-preview' existing = { 10 | name: cosmosDBName 11 | scope: resourceGroup() 12 | } 13 | 14 | resource cosmosDBOperatorRole 'Microsoft.Authorization/roleDefinitions@2022-04-01' existing = { 15 | name: '230815da-be43-4aae-9cb4-875f7bd000aa' 16 | scope: resourceGroup() 17 | } 18 | 19 | resource cosmosDBOperatorRoleAssignment 'Microsoft.Authorization/roleAssignments@2022-04-01' = { 20 | scope: cosmosDBAccount 21 | name: guid(projectPrincipalId, cosmosDBOperatorRole.id, cosmosDBAccount.id) 22 | properties: { 23 | principalId: projectPrincipalId 24 | roleDefinitionId: cosmosDBOperatorRole.id 25 | principalType: 'ServicePrincipal' 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /infrastructure/infrastructure-setup-bicep/17-private-network-standard-user-assigned-identity-agent-setup/modules-network-secured/azure-storage-account-role-assignment.bicep: -------------------------------------------------------------------------------- 1 | param azureStorageName string 2 | param projectPrincipalId string 3 | 4 | resource storageAccount 'Microsoft.Storage/storageAccounts@2023-05-01' existing = { 5 | name: azureStorageName 6 | scope: resourceGroup() 7 | } 8 | 9 | // Blob Storage Owner: b7e6dc6d-f1e8-4753-8033-0f276bb0955b 10 | // Blob Storage Contributor: ba92f5b4-2d11-453d-a403-e96b0029c9fe 11 | resource storageBlobDataContributor 'Microsoft.Authorization/roleDefinitions@2022-05-01-preview' existing = { 12 | name: 'ba92f5b4-2d11-453d-a403-e96b0029c9fe' 13 | scope: resourceGroup() 14 | } 15 | 16 | resource storageBlobDataContributorRoleAssignmentProject 'Microsoft.Authorization/roleAssignments@2022-04-01' = { 17 | scope: storageAccount 18 | name: guid(projectPrincipalId, storageBlobDataContributor.id, storageAccount.id) 19 | properties: { 20 | principalId: projectPrincipalId 21 | roleDefinitionId: storageBlobDataContributor.id 22 | principalType: 'ServicePrincipal' 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /infrastructure/infrastructure-setup-bicep/17-private-network-standard-user-assigned-identity-agent-setup/modules-network-secured/cosmosdb-account-role-assignment.bicep: -------------------------------------------------------------------------------- 1 | // Assigns Role Cosmos DB Operator to the Project Principal ID 2 | @description('Name of the Cosmos DB resource') 3 | param cosmosDBName string 4 | 5 | @description('Principal ID of the AI project') 6 | param projectPrincipalId string 7 | 8 | 9 | resource cosmosDBAccount 'Microsoft.DocumentDB/databaseAccounts@2024-12-01-preview' existing = { 10 | name: cosmosDBName 11 | scope: resourceGroup() 12 | } 13 | 14 | resource cosmosDBOperatorRole 'Microsoft.Authorization/roleDefinitions@2022-04-01' existing = { 15 | name: '230815da-be43-4aae-9cb4-875f7bd000aa' 16 | scope: resourceGroup() 17 | } 18 | 19 | resource cosmosDBOperatorRoleAssignment 'Microsoft.Authorization/roleAssignments@2022-04-01' = { 20 | scope: cosmosDBAccount 21 | name: guid(projectPrincipalId, cosmosDBOperatorRole.id, cosmosDBAccount.id) 22 | properties: { 23 | principalId: projectPrincipalId 24 | roleDefinitionId: cosmosDBOperatorRole.id 25 | principalType: 'ServicePrincipal' 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /samples-classic/csharp/getting-started-agents/AgentFramework/AgentWithHostedMCP/agent.yaml: -------------------------------------------------------------------------------- 1 | name: AgentWithHostedMCP 2 | displayName: "Microsoft Learn Response Agent with MCP" 3 | description: > 4 | An AI agent that uses Azure OpenAI Responses with a Hosted Model Context Protocol (MCP) server. 5 | The agent answers questions by searching Microsoft Learn documentation using MCP tools. 6 | This demonstrates how MCP tools can be integrated with Azure OpenAI Responses where the service 7 | itself handles tool invocation. 8 | metadata: 9 | authors: 10 | - Microsoft Agent Framework Team 11 | tags: 12 | - Azure AI AgentServer 13 | - Microsoft Agent Framework 14 | - Model Context Protocol 15 | - MCP 16 | - Tool Call Approval 17 | template: 18 | kind: hosted 19 | name: AgentWithHostedMCP 20 | protocols: 21 | - protocol: responses 22 | version: v1 23 | environment_variables: 24 | - name: AZURE_OPENAI_ENDPOINT 25 | value: ${AZURE_OPENAI_ENDPOINT} 26 | - name: AZURE_OPENAI_DEPLOYMENT_NAME 27 | value: "{{chat}}" 28 | resources: 29 | - name: chat 30 | kind: model 31 | id: gpt-4o-mini 32 | -------------------------------------------------------------------------------- /samples-classic/typescript/quickstart/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "foundry-samples-quickstart", 3 | "version": "1.0.0", 4 | "description": "TypeScript AI Foundry Quickstart", 5 | "homepage": "https://github.com/azure-ai-foundry/foundry-samples#readme", 6 | "bugs": { 7 | "url": "https://github.com/azure-ai-foundry/foundry-samples/issues" 8 | }, 9 | "repository": { 10 | "type": "git", 11 | "url": "https://github.com/azure-ai-foundry/foundry-samples.git" 12 | }, 13 | "license": "MIT", 14 | "author": "Dan Wahlin, Julia Muiruri", 15 | "type": "module", 16 | "main": "dist/quickstart.js", 17 | "scripts": { 18 | "start": "tsx --no-deprecation src/quickstart.ts", 19 | "build": "npx tsc", 20 | "dev": "tsx watch --no-deprecation src/quickstart.ts", 21 | "type-check": "npx tsc --noEmit" 22 | }, 23 | "dependencies": { 24 | "@azure/ai-projects": "1.0.0", 25 | "@azure/ai-agents": "1.1.0", 26 | "@azure/identity": "^4.11.1", 27 | "dotenv": "^17.2.1" 28 | }, 29 | "devDependencies": { 30 | "@types/node": "^24.3.0", 31 | "tsx": "^4.20.4", 32 | "typescript": "^5.9.2" 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /samples/typescript/enterprise-agent-tutorial/1-idea-to-prototype/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "modern-workplace-assistant", 3 | "version": "1.0.0", 4 | "description": "Azure AI Foundry Agent Sample - Tutorial 1: Modern Workplace Assistant (TypeScript)", 5 | "main": "dist/main.js", 6 | "scripts": { 7 | "build": "tsc", 8 | "start": "node dist/main.js", 9 | "evaluate": "node dist/evaluate.js", 10 | "dev": "tsc && node dist/main.js", 11 | "clean": "rimraf dist/" 12 | }, 13 | "keywords": [ 14 | "azure", 15 | "ai", 16 | "agents", 17 | "typescript" 18 | ], 19 | "author": "Microsoft Corporation", 20 | "license": "MIT", 21 | "dependencies": { 22 | "@azure/ai-agents-ii": "file:f:/git/agentsv2-preview/javascript/package/ai-agents-ii-2.0.0-alpha.20251020.12.tgz", 23 | "@azure/ai-projects": "^1.0.0-beta.1", 24 | "@azure/identity": "^4.11.1", 25 | "dotenv": "^16.4.5", 26 | "openai": "^6.2.0" 27 | }, 28 | "devDependencies": { 29 | "@types/node": "^20.0.0", 30 | "rimraf": "^5.0.0", 31 | "typescript": "^5.9.3" 32 | }, 33 | "engines": { 34 | "node": ">=20.0.0" 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2025 Microsoft Corporation 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /samples-classic/csharp/quickstart/Samples/SimpleInference.cs: -------------------------------------------------------------------------------- 1 | // 2 | using System.ClientModel.Primitives; 3 | using Azure.Identity; 4 | using OpenAI; 5 | using OpenAI.Chat; 6 | 7 | #pragma warning disable OPENAI001 8 | 9 | string projectEndpoint = System.Environment.GetEnvironmentVariable("AZURE_AI_INFERENCE")!; 10 | string modelDeploymentName = System.Environment.GetEnvironmentVariable("AZURE_AI_MODEL")!; 11 | 12 | BearerTokenPolicy tokenPolicy = new( 13 | new DefaultAzureCredential(), 14 | "https://ai.azure.com/.default"); 15 | OpenAIClient openAIClient = new( 16 | authenticationPolicy: tokenPolicy, 17 | options: new OpenAIClientOptions() 18 | { 19 | Endpoint = new($"{projectEndpoint}/openai/v1"), 20 | }); 21 | ChatClient chatClient = openAIClient.GetChatClient(modelDeploymentName); 22 | 23 | ChatCompletion completion = await chatClient.CompleteChatAsync( 24 | [ 25 | new SystemChatMessage("You are a helpful assistant."), 26 | new UserChatMessage("How many feet are in a mile?") 27 | ]); 28 | 29 | Console.WriteLine(completion.Content[0].Text); 30 | // 31 | -------------------------------------------------------------------------------- /samples/csharp/FoundryA365/scripts/post-provision.ps1: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env pwsh 2 | Write-Host "Starting post-provision script..." 3 | 4 | # AZURE_LOCATION is a default azd environment variable 5 | Write-Host "Resources were deployed to: location $env:AZURE_LOCATION blueprintId $env:AZURE_AGENT_IDENTITY_BLUEPRINT_ID subscriptionId $env:AZURE_SUBSCRIPTION_ID applicationName $env:AZURE_APPLICATION_NAME" 6 | 7 | Write-Host "===============Publishing digital worker===============" 8 | 9 | & "$PSScriptRoot/publish-digital-worker.ps1" 10 | 11 | # TODO: temporary fix until service starts doing it. 12 | # oAuth2grants for blueprint SP for inheritable scopes to work. 13 | Write-Host "===============OAuth2 grants for blueprint SP===============" 14 | & "$PSScriptRoot/create-blueprintsp-oauth2-grants.ps1" 15 | 16 | 17 | Write-Host "===============Building and pushing Docker image===============" 18 | & "$PSScriptRoot/build-docker-image.ps1" 19 | 20 | Write-Host "===============Creating Foundry container agent===============" 21 | & "$PSScriptRoot/create-foundry-container-agent.ps1" 22 | 23 | 24 | 25 | Write-Host "" 26 | Write-Host "Post-provision script finished." 27 | -------------------------------------------------------------------------------- /samples/csharp/FoundryA365/src/hello_world_a365_agent/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://json.schemastore.org/launchsettings.json", 3 | "profiles": { 4 | "http": { 5 | "commandName": "Project", 6 | "dotnetRunMessages": true, 7 | "launchBrowser": false, 8 | "applicationUrl": "http://localhost:6280", 9 | "environmentVariables": { 10 | "ASPNETCORE_ENVIRONMENT": "Development", 11 | "EnableKairoTracing": "true", 12 | "KairoAppInsightsConnectionString": "", 13 | "MCP_PLATFORM_ENDPOINT": "https://agent365.svc.cloud.microsoft" 14 | } 15 | }, 16 | "https": { 17 | "commandName": "Project", 18 | "dotnetRunMessages": true, 19 | "launchBrowser": true, 20 | "applicationUrl": "https://localhost:7268;http://localhost:6280", 21 | "environmentVariables": { 22 | "ASPNETCORE_ENVIRONMENT": "Development", 23 | "EnableKairoTracing": "true", 24 | "KairoAppInsightsConnectionString": "", 25 | "MCP_PLATFORM_ENDPOINT": "https://agent365.svc.cloud.microsoft" 26 | } 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /samples/csharp/hosted-agents/AgentWithTextSearchRag/agent.yaml: -------------------------------------------------------------------------------- 1 | name: AgentWithTextSearchRag 2 | displayName: "Text Search RAG Agent" 3 | description: > 4 | An AI agent that uses TextSearchProvider for retrieval augmented generation (RAG) capabilities. 5 | The agent runs searches against an external knowledge base before each model invocation and 6 | injects the results into the model context. It can answer questions about Contoso Outdoors 7 | policies and products, including return policies, refunds, shipping options, and product care 8 | instructions such as tent maintenance. 9 | metadata: 10 | authors: 11 | - Microsoft Agent Framework Team 12 | tags: 13 | - Azure AI AgentServer 14 | - Microsoft Agent Framework 15 | - Retrieval-Augmented Generation 16 | - RAG 17 | template: 18 | kind: hosted 19 | name: AgentWithTextSearchRag 20 | protocols: 21 | - protocol: responses 22 | version: v1 23 | environment_variables: 24 | - name: AZURE_OPENAI_ENDPOINT 25 | value: ${AZURE_OPENAI_ENDPOINT} 26 | - name: AZURE_OPENAI_DEPLOYMENT_NAME 27 | value: "{{chat}}" 28 | resources: 29 | - name: chat 30 | kind: model 31 | id: gpt-4o-mini 32 | -------------------------------------------------------------------------------- /samples-classic/csharp/getting-started-agents/AgentFramework/AgentWithTextSearchRag/agent.yaml: -------------------------------------------------------------------------------- 1 | name: AgentWithTextSearchRag 2 | displayName: "Text Search RAG Agent" 3 | description: > 4 | An AI agent that uses TextSearchProvider for retrieval augmented generation (RAG) capabilities. 5 | The agent runs searches against an external knowledge base before each model invocation and 6 | injects the results into the model context. It can answer questions about Contoso Outdoors 7 | policies and products, including return policies, refunds, shipping options, and product care 8 | instructions such as tent maintenance. 9 | metadata: 10 | authors: 11 | - Microsoft Agent Framework Team 12 | tags: 13 | - Azure AI AgentServer 14 | - Microsoft Agent Framework 15 | - Retrieval-Augmented Generation 16 | - RAG 17 | template: 18 | kind: hosted 19 | name: AgentWithTextSearchRag 20 | protocols: 21 | - protocol: responses 22 | version: v1 23 | environment_variables: 24 | - name: AZURE_OPENAI_ENDPOINT 25 | value: ${AZURE_OPENAI_ENDPOINT} 26 | - name: AZURE_OPENAI_DEPLOYMENT_NAME 27 | value: "{{chat}}" 28 | resources: 29 | - name: chat 30 | kind: model 31 | id: gpt-4o-mini 32 | -------------------------------------------------------------------------------- /.infra/pytest_plugins/changed_samples/src/pytest_changed_samples.egg-info/PKG-INFO: -------------------------------------------------------------------------------- 1 | Metadata-Version: 2.4 2 | Name: pytest-changed-samples 3 | Version: 0.1.0 4 | Summary: A Pytest plugin to add the option to only run changed samples 5 | Classifier: Development Status :: 4 - Beta 6 | Classifier: Framework :: Pytest 7 | Classifier: Intended Audience :: Developers 8 | Classifier: Topic :: Software Development :: Testing 9 | Classifier: Programming Language :: Python 10 | Classifier: Programming Language :: Python :: 3 11 | Classifier: Programming Language :: Python :: 3.8 12 | Classifier: Programming Language :: Python :: 3.9 13 | Classifier: Programming Language :: Python :: 3.10 14 | Classifier: Programming Language :: Python :: 3.11 15 | Classifier: Programming Language :: Python :: 3 :: Only 16 | Classifier: Programming Language :: Python :: Implementation :: CPython 17 | Classifier: Programming Language :: Python :: Implementation :: PyPy 18 | Classifier: Operating System :: OS Independent 19 | Classifier: License :: OSI Approved :: MIT License 20 | Requires-Python: >=3.8 21 | Description-Content-Type: text/markdown 22 | Requires-Dist: gitpython~=3.0 23 | Requires-Dist: pytest>=7.0.0 24 | 25 | # pytest-changed-samples 26 | 27 | 28 | -------------------------------------------------------------------------------- /infrastructure/infrastructure-setup-bicep/31-customer-managed-keys-standard-agent/modules-standard/cosmos-container-role-assignments.bicep: -------------------------------------------------------------------------------- 1 | // Assigns the necessary roles to the AI project 2 | 3 | @description('Name of the AI Search resource') 4 | param cosmosAccountName string 5 | 6 | @description('Project name') 7 | param projectPrincipalId string 8 | 9 | resource cosmosAccount 'Microsoft.DocumentDB/databaseAccounts@2024-12-01-preview' existing = { 10 | name: cosmosAccountName 11 | scope: resourceGroup() 12 | } 13 | 14 | var roleDefinitionId = resourceId( 15 | 'Microsoft.DocumentDB/databaseAccounts/sqlRoleDefinitions', 16 | cosmosAccountName, 17 | '00000000-0000-0000-0000-000000000002' 18 | ) 19 | 20 | var accountScope = '/subscriptions/${subscription().subscriptionId}/resourceGroups/${resourceGroup().name}/providers/Microsoft.DocumentDB/databaseAccounts/${cosmosAccountName}' 21 | 22 | resource containerRoleAssignmentUserContainer 'Microsoft.DocumentDB/databaseAccounts/sqlRoleAssignments@2022-05-15' = { 23 | parent: cosmosAccount 24 | name: guid(cosmosAccountName, roleDefinitionId, projectPrincipalId) 25 | properties: { 26 | principalId: projectPrincipalId 27 | roleDefinitionId: roleDefinitionId 28 | scope: accountScope 29 | } 30 | } 31 | 32 | -------------------------------------------------------------------------------- /infrastructure/infrastructure-setup-bicep/45-basic-agent-bing/modules/add-bing-search-tool.bicep: -------------------------------------------------------------------------------- 1 | param account_name string = 'aiservicesy4si' 2 | param bingSearchName string = 'bingsearch-${account_name}' 3 | 4 | #disable-next-line BCP081 5 | resource account_name_resource 'Microsoft.CognitiveServices/accounts@2025-04-01-preview' existing = { 6 | name: account_name 7 | scope: resourceGroup() 8 | } 9 | 10 | #disable-next-line BCP081 11 | resource bingSearch 'Microsoft.Bing/accounts@2020-06-10' = { 12 | name: bingSearchName 13 | location: 'global' 14 | sku: { 15 | name: 'G1' 16 | } 17 | kind: 'Bing.Grounding' 18 | } 19 | 20 | #disable-next-line BCP081 21 | resource bing_search_account_connection 'Microsoft.CognitiveServices/accounts/connections@2025-04-01-preview' = { 22 | name: '${account_name}-bingsearchconnection' 23 | parent: account_name_resource 24 | properties: { 25 | category: 'ApiKey' 26 | target: 'https://api.bing.microsoft.com/' 27 | authType: 'ApiKey' 28 | credentials: { 29 | key: '${listKeys(bingSearch.id, '2020-06-10').key1}' 30 | } 31 | isSharedToAll: true 32 | metadata: { 33 | ApiType: 'Azure' 34 | Location: bingSearch.location 35 | ResourceId: bingSearch.id 36 | } 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /samples-classic/csharp/quickstart/README.md: -------------------------------------------------------------------------------- 1 | # C# Getting Started Sample 2 | 3 | This sample demonstrates how to use the AI Foundry platform with C#/.NET. It provides basic examples for authentication, accessing data, and performing common operations with the Foundry APIs. 4 | 5 | ## Prerequisites 6 | 7 | - [.NET SDK](https://dotnet.microsoft.com/download) (version 9.0 or later recommended) 8 | - Visual Studio 22 or Visual Studio Code 9 | 10 | ## Install Dependencies 11 | 12 | 13 | ## Setup 14 | 15 | 1. Clone this repository 16 | 2. Set up your Azure Ai Foundry account and secrets at the .env file 17 | 18 | ## NOTE 19 | 20 | - The sample in SimpleInference.cs uses a diferent endpoint. In this case, you will need to set the environment variable `AZURE_AI_ENDPOINT` to the root of the AI Foundry endpoint, e.g. `https://{your-resource-name}.services.ai.azure.com/`. While the other samples use `AZURE_AI_ENDPOINT` which should be set to the full endpoint, e.g. `https://{your-resource-name}.services.ai.azure.com/api/projects/{project-id}`. 21 | 22 | - The agent samples require the `AZURE_AI_MODEL` environment variable to be set to an OpenAI-compatible model, e.g. `gpt-4.1`, as not all models are supported for agent use cases, including tooling. 23 | 24 | ## Running the Sample 25 | -------------------------------------------------------------------------------- /infrastructure/infrastructure-setup-bicep/18-managed-virtual-network-preview/modules-network-secured/add-project-capability-host.bicep: -------------------------------------------------------------------------------- 1 | param cosmosDBConnection string 2 | param azureStorageConnection string 3 | param aiSearchConnection string 4 | param projectName string 5 | param accountName string 6 | param projectCapHost string 7 | 8 | var threadConnections = ['${cosmosDBConnection}'] 9 | var storageConnections = ['${azureStorageConnection}'] 10 | var vectorStoreConnections = ['${aiSearchConnection}'] 11 | 12 | 13 | resource account 'Microsoft.CognitiveServices/accounts@2025-04-01-preview' existing = { 14 | name: accountName 15 | } 16 | 17 | resource project 'Microsoft.CognitiveServices/accounts/projects@2025-04-01-preview' existing = { 18 | name: projectName 19 | parent: account 20 | } 21 | 22 | resource projectCapabilityHost 'Microsoft.CognitiveServices/accounts/projects/capabilityHosts@2025-04-01-preview' = { 23 | name: projectCapHost 24 | parent: project 25 | properties: { 26 | capabilityHostKind: 'Agents' 27 | vectorStoreConnections: vectorStoreConnections 28 | storageConnections: storageConnections 29 | threadStorageConnections: threadConnections 30 | } 31 | 32 | } 33 | 34 | output projectCapHost string = projectCapabilityHost.name 35 | -------------------------------------------------------------------------------- /samples/java/quickstart/src/main/java/com/microsoft/foundry/samples/CreateAgent.java: -------------------------------------------------------------------------------- 1 | package com.azure.ai.agents; 2 | 3 | import com.azure.ai.agents.models.AgentVersionDetails; 4 | import com.azure.ai.agents.models.PromptAgentDefinition; 5 | import com.azure.core.util.Configuration; 6 | import com.azure.identity.DefaultAzureCredentialBuilder; 7 | 8 | public class CreateAgent { 9 | public static void main(String[] args) { 10 | String endpoint = Configuration.getGlobalConfiguration().get("PROJECT_ENDPOINT"); 11 | String model = Configuration.getGlobalConfiguration().get("MODEL_DEPLOYMENT_NAME"); 12 | // Code sample for creating an agent 13 | AgentsClient agentsClient = new AgentsClientBuilder() 14 | .credential(new DefaultAzureCredentialBuilder().build()) 15 | .endpoint(endpoint) 16 | .buildAgentsClient(); 17 | 18 | PromptAgentDefinition request = new PromptAgentDefinition(model); 19 | AgentVersionDetails agent = agentsClient.createAgentVersion("MyAgent", request); 20 | 21 | System.out.println("Agent ID: " + agent.getId()); 22 | System.out.println("Agent Name: " + agent.getName()); 23 | System.out.println("Agent Version: " + agent.getVersion()); 24 | } 25 | } -------------------------------------------------------------------------------- /infrastructure/infrastructure-setup-bicep/15-private-network-standard-agent-setup/modules-network-secured/add-project-capability-host.bicep: -------------------------------------------------------------------------------- 1 | param cosmosDBConnection string 2 | param azureStorageConnection string 3 | param aiSearchConnection string 4 | param projectName string 5 | param accountName string 6 | param projectCapHost string 7 | 8 | var threadConnections = ['${cosmosDBConnection}'] 9 | var storageConnections = ['${azureStorageConnection}'] 10 | var vectorStoreConnections = ['${aiSearchConnection}'] 11 | 12 | 13 | resource account 'Microsoft.CognitiveServices/accounts@2025-04-01-preview' existing = { 14 | name: accountName 15 | } 16 | 17 | resource project 'Microsoft.CognitiveServices/accounts/projects@2025-04-01-preview' existing = { 18 | name: projectName 19 | parent: account 20 | } 21 | 22 | resource projectCapabilityHost 'Microsoft.CognitiveServices/accounts/projects/capabilityHosts@2025-04-01-preview' = { 23 | name: projectCapHost 24 | parent: project 25 | properties: { 26 | capabilityHostKind: 'Agents' 27 | vectorStoreConnections: vectorStoreConnections 28 | storageConnections: storageConnections 29 | threadStorageConnections: threadConnections 30 | } 31 | 32 | } 33 | 34 | output projectCapHost string = projectCapabilityHost.name 35 | -------------------------------------------------------------------------------- /infrastructure/infrastructure-setup-terraform/15b-private-network-standard-agent-setup-byovnet/code/variables.tf: -------------------------------------------------------------------------------- 1 | variable "resource_group_name_resources" { 2 | description = "The name of the existing resource group to deploy the resources into" 3 | type = string 4 | } 5 | 6 | variable "resource_group_name_dns" { 7 | description = "The name of the existing resource group where the Private DNS Zones have been created" 8 | type = string 9 | } 10 | 11 | variable "subnet_id_agent" { 12 | description = "The resource id of the subnet that has been delegated to Microsoft.Apps/environments" 13 | type = string 14 | } 15 | 16 | variable "subnet_id_private_endpoint" { 17 | description = "The resource id of the subnet that will be used to deploy Private Endpoints to" 18 | type = string 19 | } 20 | 21 | variable "subscription_id_infra" { 22 | description = "The subscription id where the Private DNS Zones are located" 23 | type = string 24 | } 25 | 26 | variable "subscription_id_resources" { 27 | description = "The subscription id where the resources will be deployed" 28 | type = string 29 | } 30 | 31 | variable "location" { 32 | description = "The name of the location to provision the resources to" 33 | type = string 34 | } 35 | -------------------------------------------------------------------------------- /infrastructure/infrastructure-setup-bicep/16-private-network-standard-agent-apim-setup-preview/modules-network-secured/add-project-capability-host.bicep: -------------------------------------------------------------------------------- 1 | param cosmosDBConnection string 2 | param azureStorageConnection string 3 | param aiSearchConnection string 4 | param projectName string 5 | param accountName string 6 | param projectCapHost string 7 | 8 | var threadConnections = ['${cosmosDBConnection}'] 9 | var storageConnections = ['${azureStorageConnection}'] 10 | var vectorStoreConnections = ['${aiSearchConnection}'] 11 | 12 | 13 | resource account 'Microsoft.CognitiveServices/accounts@2025-04-01-preview' existing = { 14 | name: accountName 15 | } 16 | 17 | resource project 'Microsoft.CognitiveServices/accounts/projects@2025-04-01-preview' existing = { 18 | name: projectName 19 | parent: account 20 | } 21 | 22 | resource projectCapabilityHost 'Microsoft.CognitiveServices/accounts/projects/capabilityHosts@2025-04-01-preview' = { 23 | name: projectCapHost 24 | parent: project 25 | properties: { 26 | capabilityHostKind: 'Agents' 27 | vectorStoreConnections: vectorStoreConnections 28 | storageConnections: storageConnections 29 | threadStorageConnections: threadConnections 30 | } 31 | 32 | } 33 | 34 | output projectCapHost string = projectCapabilityHost.name 35 | -------------------------------------------------------------------------------- /samples/csharp/FoundryA365/infra/modules/application.bicep: -------------------------------------------------------------------------------- 1 | // Parameters for the application module 2 | param accountName string 3 | param projectName string 4 | param applicationName string 5 | 6 | // Application properties 7 | param displayName string = applicationName 8 | 9 | // Agent configuration 10 | param agents array = [] 11 | 12 | // Reference to existing Cognitive Services account 13 | resource account 'Microsoft.CognitiveServices/accounts@2024-10-01' existing = { 14 | name: accountName 15 | } 16 | 17 | // Reference to existing Cognitive Services project 18 | resource project 'Microsoft.CognitiveServices/accounts/projects@2025-06-01' existing = { 19 | parent: account 20 | name: projectName 21 | } 22 | 23 | // Cognitive Services Application (child resource of project) 24 | resource application 'Microsoft.CognitiveServices/accounts/projects/applications@2025-10-01-preview' = { 25 | parent: project 26 | name: applicationName 27 | properties: { 28 | displayName: displayName 29 | agents: agents 30 | authorizationPolicy: { 31 | AuthorizationScheme: 'Channels' 32 | } 33 | } 34 | } 35 | 36 | // Outputs 37 | output baseUrl string = application.properties.baseUrl 38 | output agentIdentityBlueprintId string = application.properties.agentIdentityBlueprint.clientId 39 | -------------------------------------------------------------------------------- /infrastructure/infrastructure-setup-bicep/17-private-network-standard-user-assigned-identity-agent-setup/modules-network-secured/add-project-capability-host.bicep: -------------------------------------------------------------------------------- 1 | param cosmosDBConnection string 2 | param azureStorageConnection string 3 | param aiSearchConnection string 4 | param projectName string 5 | param accountName string 6 | param projectCapHost string 7 | 8 | var threadConnections = ['${cosmosDBConnection}'] 9 | var storageConnections = ['${azureStorageConnection}'] 10 | var vectorStoreConnections = ['${aiSearchConnection}'] 11 | 12 | 13 | resource account 'Microsoft.CognitiveServices/accounts@2025-04-01-preview' existing = { 14 | name: accountName 15 | } 16 | 17 | resource project 'Microsoft.CognitiveServices/accounts/projects@2025-04-01-preview' existing = { 18 | name: projectName 19 | parent: account 20 | } 21 | 22 | resource projectCapabilityHost 'Microsoft.CognitiveServices/accounts/projects/capabilityHosts@2025-04-01-preview' = { 23 | name: projectCapHost 24 | parent: project 25 | properties: { 26 | capabilityHostKind: 'Agents' 27 | vectorStoreConnections: vectorStoreConnections 28 | storageConnections: storageConnections 29 | threadStorageConnections: threadConnections 30 | } 31 | 32 | } 33 | 34 | output projectCapHost string = projectCapabilityHost.name 35 | -------------------------------------------------------------------------------- /infrastructure/infrastructure-setup-bicep/01-connections/model-gateway/samples/parameters-openai.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", 3 | "contentVersion": "1.0.0.0", 4 | "parameters": { 5 | "projectResourceId": { 6 | "value": "/subscriptions/YOUR-SUBSCRIPTION-ID/resourceGroups/YOUR-RG/providers/Microsoft.CognitiveServices/accounts/YOUR-AI-FOUNDRY-ACCOUNT/projects/YOUR-PROJECT" 7 | }, 8 | "targetUrl": { 9 | "value": "https://api.openai.com" 10 | }, 11 | "gatewayName": { 12 | "value": "YOUR-GATEWAY-NAME" 13 | }, 14 | "connectionName": { 15 | "value": "YOUR-CONNECTION-NAME" 16 | }, 17 | "authType": { 18 | "value": "ApiKey" 19 | }, 20 | "listModelsEndpoint": { 21 | "value": "v1/models" 22 | }, 23 | "getModelEndpoint": { 24 | "value": "v1/models/{deploymentName}" 25 | }, 26 | "deploymentProvider": { 27 | "value": "OpenAI" 28 | }, 29 | "deploymentInPath": { 30 | "value": "false" 31 | }, 32 | "authConfig": { 33 | "value": { 34 | "type": "api_key", 35 | "name": "Authorization", 36 | "format": "Bearer {api_key}" 37 | } 38 | }, 39 | "isSharedToAll": { 40 | "value": false 41 | } 42 | } 43 | } -------------------------------------------------------------------------------- /infrastructure/infrastructure-setup-bicep/18-managed-virtual-network-preview/modules-network-secured/cosmos-container-role-assignments.bicep: -------------------------------------------------------------------------------- 1 | // Assigns the necessary roles to the AI project 2 | 3 | @description('Name of the AI Search resource') 4 | param cosmosAccountName string 5 | 6 | @description('Project name') 7 | param projectPrincipalId string 8 | 9 | param projectWorkspaceId string 10 | 11 | resource cosmosAccount 'Microsoft.DocumentDB/databaseAccounts@2024-12-01-preview' existing = { 12 | name: cosmosAccountName 13 | scope: resourceGroup() 14 | } 15 | 16 | var roleDefinitionId = resourceId( 17 | 'Microsoft.DocumentDB/databaseAccounts/sqlRoleDefinitions', 18 | cosmosAccountName, 19 | '00000000-0000-0000-0000-000000000002' 20 | ) 21 | 22 | var accountScope = '/subscriptions/${subscription().subscriptionId}/resourceGroups/${resourceGroup().name}/providers/Microsoft.DocumentDB/databaseAccounts/${cosmosAccountName}' 23 | 24 | resource containerRoleAssignmentUserContainer 'Microsoft.DocumentDB/databaseAccounts/sqlRoleAssignments@2022-05-15' = { 25 | parent: cosmosAccount 26 | name: guid(projectWorkspaceId, cosmosAccountName, roleDefinitionId, projectPrincipalId) 27 | properties: { 28 | principalId: projectPrincipalId 29 | roleDefinitionId: roleDefinitionId 30 | scope: accountScope 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /infrastructure/infrastructure-setup-bicep/41-standard-agent-setup/modules-standard/cosmos-container-role-assignments.bicep: -------------------------------------------------------------------------------- 1 | // Assigns the necessary roles to the AI project 2 | 3 | @description('Name of the AI Search resource') 4 | param cosmosAccountName string 5 | 6 | @description('Project name') 7 | param projectPrincipalId string 8 | 9 | param projectWorkspaceId string 10 | 11 | resource cosmosAccount 'Microsoft.DocumentDB/databaseAccounts@2024-12-01-preview' existing = { 12 | name: cosmosAccountName 13 | scope: resourceGroup() 14 | } 15 | 16 | var roleDefinitionId = resourceId( 17 | 'Microsoft.DocumentDB/databaseAccounts/sqlRoleDefinitions', 18 | cosmosAccountName, 19 | '00000000-0000-0000-0000-000000000002' 20 | ) 21 | 22 | var accountScope = '/subscriptions/${subscription().subscriptionId}/resourceGroups/${resourceGroup().name}/providers/Microsoft.DocumentDB/databaseAccounts/${cosmosAccountName}' 23 | 24 | resource containerRoleAssignmentUserContainer 'Microsoft.DocumentDB/databaseAccounts/sqlRoleAssignments@2022-05-15' = { 25 | parent: cosmosAccount 26 | name: guid(projectWorkspaceId, cosmosAccountName, roleDefinitionId, projectPrincipalId) 27 | properties: { 28 | principalId: projectPrincipalId 29 | roleDefinitionId: roleDefinitionId 30 | scope: accountScope 31 | } 32 | } 33 | 34 | 35 | 36 | -------------------------------------------------------------------------------- /infrastructure/infrastructure-setup-bicep/15-private-network-standard-agent-setup/modules-network-secured/cosmos-container-role-assignments.bicep: -------------------------------------------------------------------------------- 1 | // Assigns the necessary roles to the AI project 2 | 3 | @description('Name of the AI Search resource') 4 | param cosmosAccountName string 5 | 6 | @description('Project name') 7 | param projectPrincipalId string 8 | 9 | param projectWorkspaceId string 10 | 11 | resource cosmosAccount 'Microsoft.DocumentDB/databaseAccounts@2024-12-01-preview' existing = { 12 | name: cosmosAccountName 13 | scope: resourceGroup() 14 | } 15 | 16 | var roleDefinitionId = resourceId( 17 | 'Microsoft.DocumentDB/databaseAccounts/sqlRoleDefinitions', 18 | cosmosAccountName, 19 | '00000000-0000-0000-0000-000000000002' 20 | ) 21 | 22 | var accountScope = '/subscriptions/${subscription().subscriptionId}/resourceGroups/${resourceGroup().name}/providers/Microsoft.DocumentDB/databaseAccounts/${cosmosAccountName}' 23 | 24 | resource containerRoleAssignmentUserContainer 'Microsoft.DocumentDB/databaseAccounts/sqlRoleAssignments@2022-05-15' = { 25 | parent: cosmosAccount 26 | name: guid(projectWorkspaceId, cosmosAccountName, roleDefinitionId, projectPrincipalId) 27 | properties: { 28 | principalId: projectPrincipalId 29 | roleDefinitionId: roleDefinitionId 30 | scope: accountScope 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /infrastructure/infrastructure-setup-bicep/43-standard-agent-setup-with-customization/modules-standard/cosmos-container-role-assignments.bicep: -------------------------------------------------------------------------------- 1 | // Assigns the necessary roles to the AI project 2 | 3 | @description('Name of the AI Search resource') 4 | param cosmosAccountName string 5 | 6 | @description('Project name') 7 | param projectPrincipalId string 8 | 9 | param projectWorkspaceId string 10 | 11 | resource cosmosAccount 'Microsoft.DocumentDB/databaseAccounts@2024-12-01-preview' existing = { 12 | name: cosmosAccountName 13 | scope: resourceGroup() 14 | } 15 | 16 | var roleDefinitionId = resourceId( 17 | 'Microsoft.DocumentDB/databaseAccounts/sqlRoleDefinitions', 18 | cosmosAccountName, 19 | '00000000-0000-0000-0000-000000000002' 20 | ) 21 | 22 | var accountScope = '/subscriptions/${subscription().subscriptionId}/resourceGroups/${resourceGroup().name}/providers/Microsoft.DocumentDB/databaseAccounts/${cosmosAccountName}' 23 | 24 | resource containerRoleAssignmentUserContainer 'Microsoft.DocumentDB/databaseAccounts/sqlRoleAssignments@2022-05-15' = { 25 | parent: cosmosAccount 26 | name: guid(projectWorkspaceId, cosmosAccountName, roleDefinitionId, projectPrincipalId) 27 | properties: { 28 | principalId: projectPrincipalId 29 | roleDefinitionId: roleDefinitionId 30 | scope: accountScope 31 | } 32 | } 33 | 34 | -------------------------------------------------------------------------------- /SUPPORT.md: -------------------------------------------------------------------------------- 1 | # TODO: The maintainer of this repo has not yet edited this file 2 | 3 | **REPO OWNER**: Do you want Customer Service & Support (CSS) support for this product/project? 4 | 5 | - **No CSS support:** Fill out this template with information about how to file issues and get help. 6 | - **Yes CSS support:** Fill out an intake form at [aka.ms/onboardsupport](https://aka.ms/onboardsupport). CSS will work with/help you to determine next steps. 7 | - **Not sure?** Fill out an intake as though the answer were "Yes". CSS will help you decide. 8 | 9 | *Then remove this first heading from this SUPPORT.MD file before publishing your repo.* 10 | 11 | # Support 12 | 13 | ## How to file issues and get help 14 | 15 | This project uses GitHub Issues to track bugs and feature requests. Please search the existing 16 | issues before filing new issues to avoid duplicates. For new issues, file your bug or 17 | feature request as a new Issue. 18 | 19 | For help and questions about using this project, please **REPO MAINTAINER: INSERT INSTRUCTIONS HERE 20 | FOR HOW TO ENGAGE REPO OWNERS OR COMMUNITY FOR HELP. COULD BE A STACK OVERFLOW TAG OR OTHER 21 | CHANNEL. WHERE WILL YOU HELP PEOPLE?**. 22 | 23 | ## Microsoft Support Policy 24 | 25 | Support for this **PROJECT or PRODUCT** is limited to the resources listed above. 26 | -------------------------------------------------------------------------------- /infrastructure/infrastructure-setup-bicep/16-private-network-standard-agent-apim-setup-preview/modules-network-secured/cosmos-container-role-assignments.bicep: -------------------------------------------------------------------------------- 1 | // Assigns the necessary roles to the AI project 2 | 3 | @description('Name of the AI Search resource') 4 | param cosmosAccountName string 5 | 6 | @description('Project name') 7 | param projectPrincipalId string 8 | 9 | param projectWorkspaceId string 10 | 11 | resource cosmosAccount 'Microsoft.DocumentDB/databaseAccounts@2024-12-01-preview' existing = { 12 | name: cosmosAccountName 13 | scope: resourceGroup() 14 | } 15 | 16 | var roleDefinitionId = resourceId( 17 | 'Microsoft.DocumentDB/databaseAccounts/sqlRoleDefinitions', 18 | cosmosAccountName, 19 | '00000000-0000-0000-0000-000000000002' 20 | ) 21 | 22 | var accountScope = '/subscriptions/${subscription().subscriptionId}/resourceGroups/${resourceGroup().name}/providers/Microsoft.DocumentDB/databaseAccounts/${cosmosAccountName}' 23 | 24 | resource containerRoleAssignmentUserContainer 'Microsoft.DocumentDB/databaseAccounts/sqlRoleAssignments@2022-05-15' = { 25 | parent: cosmosAccount 26 | name: guid(projectWorkspaceId, cosmosAccountName, roleDefinitionId, projectPrincipalId) 27 | properties: { 28 | principalId: projectPrincipalId 29 | roleDefinitionId: roleDefinitionId 30 | scope: accountScope 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /infrastructure/infrastructure-setup-bicep/17-private-network-standard-user-assigned-identity-agent-setup/modules-network-secured/cosmos-container-role-assignments.bicep: -------------------------------------------------------------------------------- 1 | // Assigns the necessary roles to the AI project 2 | 3 | @description('Name of the AI Search resource') 4 | param cosmosAccountName string 5 | 6 | @description('Project name') 7 | param projectPrincipalId string 8 | 9 | param projectWorkspaceId string 10 | 11 | resource cosmosAccount 'Microsoft.DocumentDB/databaseAccounts@2024-12-01-preview' existing = { 12 | name: cosmosAccountName 13 | scope: resourceGroup() 14 | } 15 | 16 | var roleDefinitionId = resourceId( 17 | 'Microsoft.DocumentDB/databaseAccounts/sqlRoleDefinitions', 18 | cosmosAccountName, 19 | '00000000-0000-0000-0000-000000000002' 20 | ) 21 | 22 | var accountScope = '/subscriptions/${subscription().subscriptionId}/resourceGroups/${resourceGroup().name}/providers/Microsoft.DocumentDB/databaseAccounts/${cosmosAccountName}' 23 | 24 | resource containerRoleAssignmentUserContainer 'Microsoft.DocumentDB/databaseAccounts/sqlRoleAssignments@2022-05-15' = { 25 | parent: cosmosAccount 26 | name: guid(projectWorkspaceId, cosmosAccountName, roleDefinitionId, projectPrincipalId) 27 | properties: { 28 | principalId: projectPrincipalId 29 | roleDefinitionId: roleDefinitionId 30 | scope: accountScope 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /infrastructure/infrastructure-setup-bicep/02-storage-speech-language/modules/storageAccount.bicep: -------------------------------------------------------------------------------- 1 | @description('Name of the Storage Account') 2 | param storageAccountName string 3 | 4 | @description('Location for the storage account') 5 | param location string 6 | 7 | resource storageAccount 'Microsoft.Storage/storageAccounts@2025-01-01' = { 8 | name: storageAccountName 9 | location: location 10 | sku: { 11 | name: 'Standard_RAGRS' 12 | } 13 | kind: 'StorageV2' 14 | properties: { 15 | // For Azure AI Foundry BYOS, these settings are required 16 | allowBlobPublicAccess: false 17 | allowSharedKeyAccess: true // Must be true for AI Foundry to access 18 | minimumTlsVersion: 'TLS1_2' 19 | supportsHttpsTrafficOnly: true 20 | encryption: { 21 | services: { 22 | blob: { 23 | enabled: true 24 | } 25 | file: { 26 | enabled: true 27 | } 28 | } 29 | keySource: 'Microsoft.Storage' 30 | } 31 | // Required for AI Foundry BYOS 32 | allowCrossTenantReplication: false 33 | defaultToOAuthAuthentication: false 34 | } 35 | } 36 | 37 | @description('Resource ID of the created storage account') 38 | output storageAccountId string = storageAccount.id 39 | 40 | @description('Name of the created storage account') 41 | output storageAccountName string = storageAccount.name 42 | -------------------------------------------------------------------------------- /samples/python/hosted-agents/agent_with_text_search_rag/agent.yaml: -------------------------------------------------------------------------------- 1 | # Unique identifier/name for this agent 2 | name: agent-with-text-search-rag 3 | # Brief description of what this agent does 4 | description: > 5 | An AI agent that uses a ContextProvider for retrieval augmented generation (RAG) capabilities. 6 | The agent runs searches against an external knowledge base before each model invocation and 7 | injects the results into the model context. It can answer questions about Contoso Outdoors 8 | policies and products, including return policies, refunds, shipping options, and product care 9 | instructions such as tent maintenance. 10 | metadata: 11 | # Categorization tags for organizing and discovering agents 12 | authors: 13 | - Microsoft Agent Framework Team 14 | tags: 15 | - Azure AI AgentServer 16 | - Microsoft Agent Framework 17 | - Retrieval-Augmented Generation 18 | - RAG 19 | template: 20 | name: agent-with-text-search-rag 21 | # The type of agent - "hosted" for HOBO, "container" for COBO 22 | kind: hosted 23 | protocols: 24 | - protocol: responses 25 | environment_variables: 26 | - name: AZURE_OPENAI_ENDPOINT 27 | value: ${AZURE_OPENAI_ENDPOINT} 28 | - name: AZURE_OPENAI_CHAT_DEPLOYMENT_NAME 29 | value: "{{chat}}" 30 | resources: 31 | - kind: model 32 | id: gpt-4o-mini 33 | name: chat 34 | -------------------------------------------------------------------------------- /samples/python/quickstart/quickstart-chat-with-agent.py: -------------------------------------------------------------------------------- 1 | import os 2 | from dotenv import load_dotenv 3 | from azure.identity import DefaultAzureCredential 4 | from azure.ai.projects import AIProjectClient 5 | 6 | load_dotenv() 7 | 8 | project_client = AIProjectClient( 9 | endpoint=os.environ["PROJECT_ENDPOINT"], 10 | credential=DefaultAzureCredential(), 11 | ) 12 | 13 | agent_name = os.environ["AGENT_NAME"] 14 | openai_client = project_client.get_openai_client() 15 | 16 | # Optional Step: Create a conversation to use with the agent 17 | conversation = openai_client.conversations.create() 18 | print(f"Created conversation (id: {conversation.id})") 19 | 20 | # Chat with the agent to answer questions 21 | response = openai_client.responses.create( 22 | conversation=conversation.id, #Optional conversation context for multi-turn 23 | extra_body={"agent": {"name": agent_name, "type": "agent_reference"}}, 24 | input="What is the size of France in square miles?", 25 | ) 26 | print(f"Response output: {response.output_text}") 27 | 28 | # Optional Step: Ask a follow-up question in the same conversation 29 | response = openai_client.responses.create( 30 | conversation=conversation.id, 31 | extra_body={"agent": {"name": agent_name, "type": "agent_reference"}}, 32 | input="And what is the capital city?", 33 | ) 34 | print(f"Response output: {response.output_text}") 35 | -------------------------------------------------------------------------------- /samples/csharp/quickstart/quickstart-create-agent.cs: -------------------------------------------------------------------------------- 1 | using Azure.AI.Projects; 2 | using Azure.AI.Projects.OpenAI; 3 | using Azure.Identity; 4 | 5 | string projectEndpoint = Environment.GetEnvironmentVariable("PROJECT_ENDPOINT") 6 | ?? throw new InvalidOperationException("Missing environment variable 'PROJECT_ENDPOINT'"); 7 | string modelDeploymentName = Environment.GetEnvironmentVariable("MODEL_DEPLOYMENT_NAME") 8 | ?? throw new InvalidOperationException("Missing environment variable 'MODEL_DEPLOYMENT_NAME'"); 9 | string agentName = Environment.GetEnvironmentVariable("AGENT_NAME") 10 | ?? throw new InvalidOperationException("Missing environment variable 'AGENT_NAME'"); 11 | 12 | AIProjectClient projectClient = new(new Uri(projectEndpoint), new AzureCliCredential()); 13 | 14 | AgentDefinition agentDefinition = new PromptAgentDefinition(modelDeploymentName) 15 | { 16 | Instructions = "You are a helpful assistant that answers general questions", 17 | }; 18 | 19 | AgentVersion newAgentVersion = projectClient.Agents.CreateAgentVersion( 20 | agentName, 21 | options: new(agentDefinition)); 22 | 23 | List agentVersions = projectClient.Agents.GetAgentVersions(agentName); 24 | foreach (AgentVersion agentVersion in agentVersions) 25 | { 26 | Console.WriteLine($"Agent: {agentVersion.Id}, Name: {agentVersion.Name}, Version: {agentVersion.Version}"); 27 | } 28 | 29 | -------------------------------------------------------------------------------- /samples-classic/python/getting-started-agents/agent-framework/agent_with_text_search_rag/agent.yaml: -------------------------------------------------------------------------------- 1 | # Unique identifier/name for this agent 2 | name: agent-with-text-search-rag 3 | # Brief description of what this agent does 4 | description: > 5 | An AI agent that uses a ContextProvider for retrieval augmented generation (RAG) capabilities. 6 | The agent runs searches against an external knowledge base before each model invocation and 7 | injects the results into the model context. It can answer questions about Contoso Outdoors 8 | policies and products, including return policies, refunds, shipping options, and product care 9 | instructions such as tent maintenance. 10 | metadata: 11 | # Categorization tags for organizing and discovering agents 12 | authors: 13 | - Microsoft Agent Framework Team 14 | tags: 15 | - Azure AI AgentServer 16 | - Microsoft Agent Framework 17 | - Retrieval-Augmented Generation 18 | - RAG 19 | template: 20 | name: agent-with-text-search-rag 21 | # The type of agent - "hosted" for HOBO, "container" for COBO 22 | kind: hosted 23 | protocols: 24 | - protocol: responses 25 | environment_variables: 26 | - name: AZURE_OPENAI_ENDPOINT 27 | value: ${AZURE_OPENAI_ENDPOINT} 28 | - name: AZURE_OPENAI_CHAT_DEPLOYMENT_NAME 29 | value: "{{chat}}" 30 | resources: 31 | - kind: model 32 | id: gpt-4o-mini 33 | name: chat 34 | -------------------------------------------------------------------------------- /infrastructure/infrastructure-setup-bicep/01-connections/apim/samples/parameters-dynamic-discovery.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", 3 | "contentVersion": "1.0.0.0", 4 | "parameters": { 5 | "projectResourceId": { 6 | "value": "/subscriptions/YOUR-SUBSCRIPTION-ID/resourceGroups/YOUR-RG/providers/Microsoft.CognitiveServices/accounts/YOUR-AI-FOUNDRY-ACCOUNT/projects/YOUR-PROJECT" 7 | }, 8 | "apimResourceId": { 9 | "value": "/subscriptions/YOUR-SUBSCRIPTION-ID/resourceGroups/YOUR-APIM-RG/providers/Microsoft.ApiManagement/service/YOUR-APIM-SERVICE" 10 | }, 11 | "apiName": { 12 | "value": "YOUR-API-NAME" 13 | }, 14 | "connectionName": { 15 | "value": "YOUR-CONNECTION-NAME" 16 | }, 17 | "authType": { 18 | "value": "ApiKey" 19 | }, 20 | "isSharedToAll": { 21 | "value": false 22 | }, 23 | "deploymentInPath": { 24 | "value": "true" 25 | }, 26 | "inferenceAPIVersion": { 27 | "value": "2025-03-01-preview" 28 | }, 29 | "deploymentAPIVersion": { 30 | "value": "" 31 | }, 32 | "listModelsEndpoint": { 33 | "value": "/deployments" 34 | }, 35 | "getModelEndpoint": { 36 | "value": "/deployments/{deploymentName}" 37 | }, 38 | "deploymentProvider": { 39 | "value": "AzureOpenAI" 40 | } 41 | } 42 | } -------------------------------------------------------------------------------- /samples/csharp/FoundryA365/src/hello_world_a365_agent/AgentLogic/AgentInstructions.cs: -------------------------------------------------------------------------------- 1 | namespace HelloWorldA365.AgentLogic; 2 | 3 | using HelloWorldA365.Models; 4 | 5 | /// 6 | /// Shared instructions for agents across different implementations. 7 | /// 8 | public static class AgentInstructions 9 | { 10 | /// 11 | /// Gets the agent instructions. 12 | /// 13 | /// The agent metadata. 14 | /// The formatted instructions string. 15 | public static string GetInstructions(AgentMetadata agent) => 16 | $""" 17 | 18 | You are a helpful agent named FoundryDigitalWorker. 19 | Help user achieve their objectives. 20 | 21 | # Onboarding 22 | When prompted for onboarding, inquire about: 23 | - Document to track leads 24 | 25 | # General 26 | - Be precise and professional in your responses 27 | - Format responses in html 28 | 29 | When handling email-related requests: 30 | - Use professional and formal language in all email correspondence 31 | - Use the SendEmail function to send any responses back 32 | - You can use AAD object ID inside the Activity context's 'From' Field to determine where to respond to emails from. 33 | 34 | """.Trim(); 35 | } -------------------------------------------------------------------------------- /.infra/pytest_plugins/changed_samples/pyproject.toml: -------------------------------------------------------------------------------- 1 | [build-system] 2 | requires = ["setuptools"] 3 | build-backend = "setuptools.build_meta" 4 | 5 | [project] 6 | name = "pytest-changed-samples" 7 | version = "0.1.0" 8 | authors = [] 9 | readme = "README.md" 10 | classifiers = [ 11 | "Development Status :: 4 - Beta", 12 | "Framework :: Pytest", 13 | "Intended Audience :: Developers", 14 | "Topic :: Software Development :: Testing", 15 | "Programming Language :: Python", 16 | "Programming Language :: Python :: 3", 17 | "Programming Language :: Python :: 3.8", 18 | "Programming Language :: Python :: 3.9", 19 | "Programming Language :: Python :: 3.10", 20 | "Programming Language :: Python :: 3.11", 21 | "Programming Language :: Python :: 3 :: Only", 22 | "Programming Language :: Python :: Implementation :: CPython", 23 | "Programming Language :: Python :: Implementation :: PyPy", 24 | "Operating System :: OS Independent", 25 | "License :: OSI Approved :: MIT License", 26 | ] 27 | description = "A Pytest plugin to add the option to only run changed samples" 28 | requires-python = ">=3.8" 29 | dependencies = ["gitpython~=3.0", "pytest>=7.0.0"] 30 | 31 | 32 | [project.entry-points.pytest11] 33 | changed_samples = "pytest_changed_samples.plugin" 34 | 35 | [tool.setuptools.packages.find] 36 | where = ["src"] 37 | 38 | [tool.black] 39 | line-length = 120 40 | 41 | [tool.ruff] 42 | line-length = 120 43 | -------------------------------------------------------------------------------- /samples-classic/python/getting-started-agents/openapi/countries.json: -------------------------------------------------------------------------------- 1 | { 2 | "openapi": "3.1.0", 3 | "info": { 4 | "title": "RestCountries.NET API", 5 | "description": "Web API version 3.1 for managing country items, based on previous implementations from restcountries.eu and restcountries.com.", 6 | "version": "v3.1" 7 | }, 8 | "servers": [ 9 | { "url": "https://restcountries.net" } 10 | ], 11 | "auth": [], 12 | "paths": { 13 | "/v3.1/currency": { 14 | "get": { 15 | "description": "Search by currency.", 16 | "operationId": "LookupCountryByCurrency", 17 | "parameters": [ 18 | { 19 | "name": "currency", 20 | "in": "query", 21 | "description": "The currency to search for.", 22 | "required": true, 23 | "schema": { 24 | "type": "string" 25 | } 26 | } 27 | ], 28 | "responses": { 29 | "200": { 30 | "description": "Success", 31 | "content": { 32 | "text/plain": { 33 | "schema": { 34 | "type": "string" 35 | } 36 | } 37 | } 38 | } 39 | } 40 | } 41 | } 42 | }, 43 | "components": { 44 | "schemes": {} 45 | } 46 | } -------------------------------------------------------------------------------- /infrastructure/infrastructure-setup-bicep/15-private-network-standard-agent-setup/add-project.bicepparam: -------------------------------------------------------------------------------- 1 | using './add-project.bicep' 2 | 3 | param location = 'westus' 4 | 5 | // New project details 6 | param projectName = 'secondproject' 7 | param projectDescription = 'Second AI Foundry project with network secured deployed Agent' 8 | param displayName = 'Second Project' 9 | param projectCapHost = 'caphostsecond' 10 | 11 | // Existing AI Services account details (from your original deployment) 12 | // You'll need to get these from your existing deployment 13 | param existingAccountName = '' // Replace with your actual account name 14 | param accountResourceGroupName = '' // Your resource group 15 | param accountSubscriptionId = '' 16 | 17 | // Existing shared resources (from your original deployment) 18 | // You'll need to get these from your existing deployment outputs 19 | param existingAiSearchName = '' // Replace with your actual search service name 20 | param aiSearchResourceGroupName = '' // Your resource group 21 | param aiSearchSubscriptionId = '' 22 | 23 | param existingStorageName = '' // Replace with your actual storage account name 24 | param storageResourceGroupName = '' // Your resource group 25 | param storageSubscriptionId = '' 26 | 27 | param existingCosmosDBName = '' // Replace with your actual Cosmos DB name 28 | param cosmosDBResourceGroupName = '' // Your resource group 29 | param cosmosDBSubscriptionId = '' 30 | -------------------------------------------------------------------------------- /samples-classic/typescript/quickstart/README.md: -------------------------------------------------------------------------------- 1 | # TypeScript QuickStart 2 | 3 | This sample demonstrates how to use Azure AI Foundry with TypeScript for chat completions and AI agents. 4 | 5 | ## Set up your environment 6 | 7 | 1. [Install Node.js (LTS is recommended) and the Azure CLI](https://learn.microsoft.com/en-us/azure/ai-foundry/how-to/develop/install-cli-sdk). 8 | 9 | 1. Make sure to sign in using the CLI `az login` (or `az login --use-device-code`) command to authenticate before running the project. 10 | 11 | 1. Copy `.env.template` to `.env` and place it in the root of your project directory. 12 | 13 | 1. Open the `.env` file and fill in the following variables based upon your AI Foundry resource and project names: 14 | - `MODEL_DEPLOYMENT_NAME`: Your deployed Azure OpenAI model. Defaults to `gpt-4o`. 15 | - `PROJECT_ENDPOINT`: The endpoint for your AI Foundry project. 16 | 17 | 1. Install packages with `npm install`. 18 | 19 | ## Run a chat completion and agent 20 | 21 | ### Development Mode 22 | 23 | Run with hot reload during development: 24 | 25 | ```bash 26 | npm run dev 27 | ``` 28 | 29 | ### Production Mode 30 | 31 | Run the TypeScript directly: 32 | 33 | ```bash 34 | npm start 35 | ``` 36 | 37 | ### Build Mode 38 | 39 | Compile TypeScript to JavaScript: 40 | 41 | ```bash 42 | npm run build 43 | ``` 44 | 45 | ### Type Check 46 | 47 | Check types without running: 48 | ```bash 49 | npm run type-check 50 | ``` -------------------------------------------------------------------------------- /infrastructure/infrastructure-setup-bicep/20-user-assigned-identity/README.md: -------------------------------------------------------------------------------- 1 | --- 2 | description: This template deploys an Azure AI Foundry account, project, and model deployment with your User-Assigned Managed Identity. 3 | page_type: sample 4 | products: 5 | - azure 6 | - azure-resource-manager 7 | urlFragment: aifoundry-uai 8 | languages: 9 | - bicep 10 | - json 11 | --- 12 | # Set up Azure AI Foundry with user-assigned identity 13 | 14 | This Azure AI Foundry template is built on Azure Cognitive Services as a resource provider. This template deploys an Azure AI Foundry account and project, previously known as Azure AI Services. 15 | 16 | Run the command for BICEP: 17 | 18 | az deployment group create --name "{DEPLOYMENT_NAME}" --resource-group "{RESOURCE_GROUP_NAME}" --template-file ./main.bicep --parameters userAssignedIdentityName="{UASER_ASSIGNED_MANAGED_IDENTITY_NAME}" 19 | 20 | Limitations: 21 | 1. User-Assigned Managed Identity is not supported with Customer Managed Keys. 22 | 23 | If you are new to Azure AI Foundry, see: 24 | 25 | - [Azure AI Foundry](https://learn.microsoft.com/azure/ai-foundry/) 26 | 27 | If you are new to template deployment, see: 28 | 29 | - [Azure Resource Manager documentation](https://learn.microsoft.com/azure/azure-resource-manager/) 30 | - [Azure AI services quickstart article](https://learn.microsoft.com/azure/cognitive-services/resource-manager-template) 31 | 32 | `Tags: Microsoft.CognitiveServices/accounts/projects` -------------------------------------------------------------------------------- /infrastructure/infrastructure-setup-bicep/02-storage-speech-language/README.md: -------------------------------------------------------------------------------- 1 | # Bring Your Own Azure Storage for Speech and Language capabilities (Preview) 2 | 3 | Use this template to associate your Azure Storage account to a new Foundry resource. This template allows you to bring an existing Azure Storage account as the storage for your Speech and Language usecases. Learn more about this feature's restrictions via our public documentation. 4 | 5 | ## Advanced implementation details 6 | ### How is this setup different from an Azure Storage connection in Foundry? 7 | This template does not use the Foundry connections API. The [Foundry resource connections API](https://learn.microsoft.com/en-us/rest/api/aifoundry/accountmanagement/account-connections?view=rest-aifoundry-accountmanagement-2025-06-01) and [Foundry project connections API](https://learn.microsoft.com/en-us/rest/api/aifoundry/aiprojects/connections?view=rest-aifoundry-aiprojects-v1) use the Foundry endpoint to store authentication details like API keys and target. The Azure Storage association to a Foundry resource does not use that API. Instead, there is a field under `properties` in the Foundry resource creation step, that sets the Azure Storage resource ID. This field allows for backwards compatibility with how previous Speech Services and Language kinds do. 8 | 9 | ### What authentication methods are supported? 10 | This association does not support API key authentication, only RBAC authentication. 11 | 12 | -------------------------------------------------------------------------------- /infrastructure/infrastructure-setup-bicep/01-connections/model-gateway/samples/parameters-dynamic.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", 3 | "contentVersion": "1.0.0.0", 4 | "parameters": { 5 | "projectResourceId": { 6 | "value": "/subscriptions/YOUR-SUBSCRIPTION-ID/resourceGroups/YOUR-RG/providers/Microsoft.CognitiveServices/accounts/YOUR-AI-FOUNDRY-ACCOUNT/projects/YOUR-PROJECT" 7 | }, 8 | "targetUrl": { 9 | "value": "YOUR-MODEL-GATEWAY-URL" 10 | }, 11 | "gatewayName": { 12 | "value": "YOUR-GATEWAY-NAME" 13 | }, 14 | "connectionName": { 15 | "value": "YOUR-CONNECTION-NAME" 16 | }, 17 | "authType": { 18 | "value": "ApiKey" 19 | }, 20 | "isSharedToAll": { 21 | "value": false 22 | }, 23 | "listModelsEndpoint": { 24 | "value": "/deployments" 25 | }, 26 | "getModelEndpoint": { 27 | "value": "/deployments/{deploymentName}" 28 | }, 29 | "deploymentProvider": { 30 | "value": "AzureOpenAI" 31 | }, 32 | "deploymentAPIVersion": { 33 | "value": "" 34 | }, 35 | "deploymentInPath": { 36 | "value": "false" 37 | }, 38 | "inferenceAPIVersion": { 39 | "value": "" 40 | }, 41 | "customHeaders": { 42 | "value": { 43 | "YOUR-HEADER-NAME-1": "YOUR-HEADER-VALUE-1", 44 | "YOUR-HEADER-NAME-2": "YOUR-HEADER-VALUE-2" 45 | } 46 | } 47 | } 48 | } -------------------------------------------------------------------------------- /samples/REST/quickstart/quickstart-chat-with-agent.sh: -------------------------------------------------------------------------------- 1 | # Optional Step: Create a conversation to use with the agent 2 | curl -X POST https://YOUR-FOUNDRY-RESOURCE-NAME.services.ai.azure.com/api/projects/YOUR-PROJECT-NAME/openai/conversations?api-version=2025-11-15-preview \ 3 | -H "Content-Type: application/json" \ 4 | -H "Authorization: Bearer $AZURE_AI_AUTH_TOKEN" \ 5 | -d '{}' 6 | # Lets say Conversation ID created is conv_123456789. Use this in the next step 7 | 8 | #Chat with the agent to answer questions 9 | curl -X POST https://YOUR-FOUNDRY-RESOURCE-NAME.services.ai.azure.com/api/projects/YOUR-PROJECT-NAME/openai/responses?api-version=2025-11-15-preview \ 10 | -H "Content-Type: application/json" \ 11 | -H "Authorization: Bearer $AZURE_AI_AUTH_TOKEN" \ 12 | -d '{ 13 | "agent": {"type": "agent_reference", "name": "MyAgent"}, 14 | "conversation" : "", 15 | "input" : "What is the size of France in square miles?" 16 | }' 17 | 18 | #Optional Step: Ask a follow-up question in the same conversation 19 | curl -X POST https://YOUR-FOUNDRY-RESOURCE-NAME.services.ai.azure.com/api/projects/YOUR-PROJECT-NAME/openai/responses?api-version=2025-11-15-preview \ 20 | -H "Content-Type: application/json" \ 21 | -H "Authorization: Bearer $AZURE_AI_AUTH_TOKEN" \ 22 | -d '{ 23 | "agent": {"type": "agent_reference", "name": "MyAgent"}, 24 | "conversation" : "", 25 | "input" : "And what is the capital city?" 26 | }' --------------------------------------------------------------------------------