Skip to content

Commit 07ada1d

Browse files
foundry-samples-repo-sync[bot]deeikelehuimiu
authored
Automated sync from private repo (2026-03-26) (#625)
* tf samples to match bicep (#101) * ci: add CODEOWNERS entries (#106) * Update sync state to 12648bcde39f --------- Co-authored-by: Dennis Eikelenboom <92387505+deeikele@users.noreply.github.com> Co-authored-by: Hui Miao <miuhui@outlook.com> Co-authored-by: foundry-samples-repo-sync[bot] <foundry-samples-repo-sync[bot]@users.noreply.github.com>
1 parent aadb06f commit 07ada1d

128 files changed

Lines changed: 6322 additions & 83 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/.sync-sha

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
a62fc7d87bb4abd1929c1858296bb29269499697
1+
12648bcde39fef0e73e7f53d55691ebeb8763379

.github/CODEOWNERS

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,3 +39,5 @@
3939
/samples/typescript/quickstart/chat-with-agent/src/quickstart-chat-with-agent.ts @microsoft-foundry/AI-Platform-Docs
4040
/samples/typescript/quickstart/create-agent/src/quickstart-create-agent.ts @microsoft-foundry/AI-Platform-Docs
4141
/samples/typescript/quickstart/responses/src/quickstart-responses.ts @microsoft-foundry/AI-Platform-Docs
42+
samples/python/hosted-agents/agent-framework/azure-ai-agents-in-workflow @microsoft-foundry/foundry-vscode-extension
43+
samples/csharp/hosted-agents/AgentFramework/AzureAIAgentsInWorkflow @microsoft-foundry/foundry-vscode-extension
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# This directory is owned by @azure-ai-foundry/ai-platform-docs (see CODEOWNERS).
2+
# Its .tf files use intentional non-standard HCL formatting that must not be changed.
3+
# Skipped by infrastructure/infrastructure-setup-terraform/scripts/validate.sh.

infrastructure/infrastructure-setup-terraform/00-basic-azurerm/README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
description: This set of templates demonstrates how to set up Azure AI Foundry in the basic configuration with public network setup and Microsoft-managed storage resources using AzureRM provider.
2+
description: This set of templates demonstrates how to set up Microsoft Foundry in the basic configuration with public network setup and Microsoft-managed storage resources using AzureRM provider.
33
page_type: sample
44
products:
55
- azure
@@ -9,11 +9,11 @@ languages:
99
- hcl
1010
---
1111

12-
# Azure AI Foundry: Basic setup with public networking (AzureRM)
12+
# Microsoft Foundry: Basic setup with public networking (AzureRM)
1313

1414
## Key Information
1515

16-
This infrastructure-as-code (IaC) solution deploys Azure AI Foundry with public networking and uses Microsoft-managed storage for file upload experience. It supports getting started scenarios, for typically non-enterprise scenarios. This variant shows AzureRM Terraform provider.
16+
This infrastructure-as-code (IaC) solution deploys Microsoft Foundry with public networking and uses Microsoft-managed storage for file upload experience. It supports getting started scenarios, for typically non-enterprise scenarios. This variant shows AzureRM Terraform provider.
1717

1818
## Prerequisites
1919

@@ -99,5 +99,5 @@ code/
9999

100100
## References
101101

102-
- [Learn more about Azure AI Foundry architecture](https://learn.microsoft.com/en-us/azure/ai-foundry/concepts/architecture)
103-
- [Azure AI Foundry reference docs for Terraform](https://learn.microsoft.com/en-us/azure/ai-foundry/how-to/create-resource-terraform)
102+
- [Learn more about Microsoft Foundry architecture](https://learn.microsoft.com/en-us/azure/ai-foundry/concepts/architecture)
103+
- [Microsoft Foundry reference docs for Terraform](https://learn.microsoft.com/en-us/azure/ai-foundry/how-to/create-resource-terraform)
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
location = "eastus"
1+
location = "eastus2"
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
location = "eastus"
1+
location = "eastus2"

infrastructure/infrastructure-setup-terraform/00-basic/code/main.tf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ resource "random_string" "unique" {
1313
##
1414
resource "azapi_resource" "rg" {
1515
type = "Microsoft.Resources/resourceGroups@2021-04-01"
16-
name = "rg-aifoundry-${random_string.unique.result}"
16+
name = "tf-319-basic"
1717
location = var.location
1818
}
1919

@@ -63,7 +63,7 @@ resource "azapi_resource" "aifoundry_deployment_gpt_4o" {
6363

6464
body = {
6565
sku = {
66-
name = "GlobalStandard"
66+
name = "Standard"
6767
capacity = 1
6868
}
6969
properties = {
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# This directory contains standalone Terraform snippet files, not a complete module.
2+
# Each .tf file declares its own terraform{} and provider blocks and is meant to be
3+
# copied into an existing Terraform configuration, not run directly.
4+
# Skipped by infrastructure/infrastructure-setup-terraform/scripts/validate.sh.
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# Connections Terraform 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 Terraform examples for the most common connection categories:
6+
7+
- **AI Search**: Connect to Azure AI Search (Cognitive Search) services
8+
- **Key Vault**: Securely access secrets and keys
9+
- **Application Insights**: Enable monitoring and telemetry
10+
- **Azure OpenAI**: Connect to Azure OpenAI endpoints
11+
- **Storage Account**: Access Azure Storage for data
12+
- **Cosmos DB**: Connect to Cosmos DB databases
13+
- **Bing Grounding**: Enable Bing Search for grounding
14+
15+
## Usage
16+
17+
Each file demonstrates how to create a specific connection type using Terraform with the AzAPI provider. These are example snippets that you can integrate into your own Terraform configurations.
18+
19+
## Prerequisites
20+
21+
- An existing Microsoft Foundry account
22+
- The target resource you want to connect (e.g., AI Search service, Key Vault, etc.)
23+
- Appropriate permissions to create connections
24+
25+
## Important Notes
26+
27+
- Uses AzAPI provider for connection resources (not yet in Az
28+
ureRM)
29+
- Some connections require API keys or managed identity configuration
30+
- Role assignments may be needed for managed identity auth
31+
32+
## Documentation
33+
34+
- [Microsoft Foundry connections](https://learn.microsoft.com/en-us/azure/ai-foundry/concepts/connections)
35+
- [AzAPI Provider](https://registry.terraform.io/providers/azure/azapi/latest/docs)
36+
37+
`Tags: Microsoft.CognitiveServices/accounts/connections, Integration`
Lines changed: 108 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,108 @@
1+
# Example: Azure AI Search Connection
2+
# This example shows how to create a connection from AI Foundry to Azure AI Search
3+
4+
terraform {
5+
required_providers {
6+
azapi = {
7+
source = "azure/azapi"
8+
version = "~> 2.5"
9+
}
10+
azurerm = {
11+
source = "hashicorp/azurerm"
12+
version = "~> 4.37"
13+
}
14+
}
15+
}
16+
17+
provider "azapi" {}
18+
provider "azurerm" {
19+
features {}
20+
}
21+
22+
variable "ai_foundry_name" {
23+
description = "Name of your existing AI Foundry account"
24+
type = string
25+
}
26+
27+
variable "resource_group_name" {
28+
description = "Resource group containing AI Foundry account"
29+
type = string
30+
}
31+
32+
variable "location" {
33+
description = "Azure region"
34+
type = string
35+
default = "westus"
36+
}
37+
38+
variable "create_new_search" {
39+
description = "Create new AI Search service or use existing"
40+
type = bool
41+
default = true
42+
}
43+
44+
variable "search_service_name" {
45+
description = "Name of the AI Search service"
46+
type = string
47+
}
48+
49+
# Reference existing AI Foundry account
50+
data "azurerm_resource_group" "rg" {
51+
name = var.resource_group_name
52+
}
53+
54+
data "azapi_resource" "ai_foundry" {
55+
type = "Microsoft.CognitiveServices/accounts@2025-04-01-preview"
56+
name = var.ai_foundry_name
57+
parent_id = data.azurerm_resource_group.rg.id
58+
}
59+
60+
# Conditionally create new AI Search service
61+
resource "azurerm_search_service" "search" {
62+
count = var.create_new_search ? 1 : 0
63+
name = var.search_service_name
64+
resource_group_name = var.resource_group_name
65+
location = var.location
66+
sku = "basic"
67+
}
68+
69+
# Reference existing AI Search service
70+
data "azurerm_search_service" "existing" {
71+
count = var.create_new_search ? 0 : 1
72+
name = var.search_service_name
73+
resource_group_name = var.resource_group_name
74+
}
75+
76+
locals {
77+
search_endpoint = var.create_new_search ? "https://${azurerm_search_service.search[0].name}.search.windows.net" : "https://${data.azurerm_search_service.existing[0].name}.search.windows.net"
78+
search_id = var.create_new_search ? azurerm_search_service.search[0].id : data.azurerm_search_service.existing[0].id
79+
search_primary_key = var.create_new_search ? azurerm_search_service.search[0].primary_key : data.azurerm_search_service.existing[0].primary_key
80+
}
81+
82+
# Create AI Search connection
83+
resource "azapi_resource" "ai_search_connection" {
84+
type = "Microsoft.CognitiveServices/accounts/connections@2025-04-01-preview"
85+
name = "${var.ai_foundry_name}-aisearch"
86+
parent_id = data.azapi_resource.ai_foundry.id
87+
88+
body = {
89+
properties = {
90+
category = "CognitiveSearch"
91+
target = local.search_endpoint
92+
authType = "ApiKey"
93+
isSharedToAll = true
94+
credentials = {
95+
key = local.search_primary_key
96+
}
97+
metadata = {
98+
ApiType = "Azure"
99+
ResourceId = local.search_id
100+
location = var.location
101+
}
102+
}
103+
}
104+
}
105+
106+
output "connection_id" {
107+
value = azapi_resource.ai_search_connection.id
108+
}

0 commit comments

Comments
 (0)