Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion 5_analytics-bigdata/event-hub/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Costa Rica
[![GitHub](https://img.shields.io/badge/--181717?logo=github&logoColor=ffffff)](https://github.com/)
[brown9804](https://github.com/brown9804)

Last updated: 2026-02-16
Last updated: 2026-02-17

------------------------------------------

Expand Down Expand Up @@ -78,3 +78,10 @@ Last updated: 2026-02-16
```sh
terraform apply -auto-approve
```

<!-- START BADGE -->
<div align="center">
<img src="https://img.shields.io/badge/Total%20views-1930-limegreen" alt="Total views">
<p>Refresh Date: 2026-02-17</p>
</div>
<!-- END BADGE -->
9 changes: 8 additions & 1 deletion 5_analytics-bigdata/fabric/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Costa Rica
[![GitHub](https://img.shields.io/badge/--181717?logo=github&logoColor=ffffff)](https://github.com/)
[brown9804](https://github.com/brown9804)

Last updated: 2026-02-16
Last updated: 2026-02-17

------------------------------------------

Expand Down Expand Up @@ -83,3 +83,10 @@ Last updated: 2026-02-16
```sh
terraform apply -auto-approve
```

<!-- START BADGE -->
<div align="center">
<img src="https://img.shields.io/badge/Total%20views-1930-limegreen" alt="Total views">
<p>Refresh Date: 2026-02-17</p>
</div>
<!-- END BADGE -->
9 changes: 8 additions & 1 deletion 6_monitoring-management/advisor/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Costa Rica
[![GitHub](https://img.shields.io/badge/--181717?logo=github&logoColor=ffffff)](https://github.com/)
[brown9804](https://github.com/brown9804)

Last updated: 2026-02-16
Last updated: 2026-02-17

------------------------------------------

Expand All @@ -25,3 +25,10 @@ terraform validate
terraform plan
terraform apply -auto-approve
```

<!-- START BADGE -->
<div align="center">
<img src="https://img.shields.io/badge/Total%20views-1930-limegreen" alt="Total views">
<p>Refresh Date: 2026-02-17</p>
</div>
<!-- END BADGE -->
9 changes: 8 additions & 1 deletion 6_monitoring-management/automation/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Costa Rica
[![GitHub](https://img.shields.io/badge/--181717?logo=github&logoColor=ffffff)](https://github.com/)
[brown9804](https://github.com/brown9804)

Last updated: 2026-02-16
Last updated: 2026-02-17

------------------------------------------

Expand All @@ -32,3 +32,10 @@ terraform validate
terraform plan
terraform apply -auto-approve
```

<!-- START BADGE -->
<div align="center">
<img src="https://img.shields.io/badge/Total%20views-1930-limegreen" alt="Total views">
<p>Refresh Date: 2026-02-17</p>
</div>
<!-- END BADGE -->
9 changes: 8 additions & 1 deletion 6_monitoring-management/log-analytics/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Costa Rica
[![GitHub](https://img.shields.io/badge/--181717?logo=github&logoColor=ffffff)](https://github.com/)
[brown9804](https://github.com/brown9804)

Last updated: 2026-02-16
Last updated: 2026-02-17

------------------------------------------

Expand Down Expand Up @@ -49,3 +49,10 @@ terraform validate
terraform plan
terraform apply -auto-approve
```

<!-- START BADGE -->
<div align="center">
<img src="https://img.shields.io/badge/Total%20views-1930-limegreen" alt="Total views">
<p>Refresh Date: 2026-02-17</p>
</div>
<!-- END BADGE -->
9 changes: 8 additions & 1 deletion 6_monitoring-management/monitor/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Costa Rica
[![GitHub](https://img.shields.io/badge/--181717?logo=github&logoColor=ffffff)](https://github.com/)
[brown9804](https://github.com/brown9804)

Last updated: 2026-02-16
Last updated: 2026-02-17

------------------------------------------

Expand All @@ -22,3 +22,10 @@ terraform validate
terraform plan
terraform apply -auto-approve
```

<!-- START BADGE -->
<div align="center">
<img src="https://img.shields.io/badge/Total%20views-1930-limegreen" alt="Total views">
<p>Refresh Date: 2026-02-17</p>
</div>
<!-- END BADGE -->
9 changes: 8 additions & 1 deletion 8_ai-ml/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,20 @@ Costa Rica
[![GitHub](https://img.shields.io/badge/--181717?logo=github&logoColor=ffffff)](https://github.com/)
[brown9804](https://github.com/brown9804)

Last updated: 2026-02-09
Last updated: 2026-02-16

------------------------------------------

> [!IMPORTANT]
> This folder contains sample Terraform templates for Azure AI and machine learning services. These templates are starting points and should be customized based on your application needs.

## Templates available

- [Azure Machine Learning (Workspace)](./machine-learning)
- [Azure AI Search (Search Service)](./ai-search)
- [Azure AI Services (Cognitive Services Account)](./ai-services)
- [Microsoft Foundry (Azure AI Foundry Account + Project)](./ai-foundry)

<!-- START BADGE -->
<div align="center">
<img src="https://img.shields.io/badge/Total%20views-1930-limegreen" alt="Total views">
Expand Down
35 changes: 35 additions & 0 deletions 8_ai-ml/ai-foundry/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# Terraform Template - Microsoft Foundry (Azure AI Foundry)

Costa Rica

[![GitHub](https://img.shields.io/badge/--181717?logo=github&logoColor=ffffff)](https://github.com/)
[brown9804](https://github.com/brown9804)

Last updated: 2026-02-17

------------------------------------------

> This template creates a Microsoft Foundry account (Cognitive Services account kind `AIServices`) and an optional Foundry project.

<img width="650" alt="image" src="https://github.com/user-attachments/assets/2a2533c3-3052-43ea-be41-02eea066bdd1" />

<img width="650" alt="image" src="https://github.com/user-attachments/assets/303fb22c-3bdb-4ed3-9691-87ea72a0ecc3" />

<img width="650" alt="image" src="https://github.com/user-attachments/assets/4319f24c-e3df-483f-9a8f-73095ca4b10e" />

## Usage

```sh
az login
terraform init -upgrade
terraform validate
terraform plan
terraform apply -auto-approve
```

<!-- START BADGE -->
<div align="center">
<img src="https://img.shields.io/badge/Total%20views-1930-limegreen" alt="Total views">
<p>Refresh Date: 2026-02-17</p>
</div>
<!-- END BADGE -->
124 changes: 124 additions & 0 deletions 8_ai-ml/ai-foundry/main.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,124 @@
data "azurerm_client_config" "current" {}

resource "azapi_resource" "resource_group" {
type = "Microsoft.Resources/resourceGroups@2022-09-01"
name = var.resource_group_name
location = var.location
parent_id = "/subscriptions/${data.azurerm_client_config.current.subscription_id}"

body = jsonencode({
tags = var.tags
})

response_export_values = [
"id",
"name"
]
}

resource "random_string" "suffix" {
length = var.random_suffix_length
upper = false
special = false
numeric = true

keepers = {
resource_group_name = var.resource_group_name
location = var.location
base_name = var.foundry_account_name
sku = var.sku_name
allow_project_management = tostring(var.allow_project_management)
public_network_access = tostring(var.public_network_access_enabled)
}
}

locals {
suffix = var.append_random_suffix ? random_string.suffix.result : ""
name_raw = var.append_random_suffix ? "${var.foundry_account_name}-${local.suffix}" : var.foundry_account_name

custom_subdomain_name_effective = (
(var.custom_subdomain_name != null ? trimspace(var.custom_subdomain_name) : "") != ""
? trimspace(var.custom_subdomain_name)
: "cog-${replace(lower(local.name_raw), "_", "-")}" # best-effort derivation
)

project_name_effective = (
(var.project_name != null ? trimspace(var.project_name) : "") != ""
? trimspace(var.project_name)
: substr(replace(local.name_raw, "-", ""), 0, 64)
)

project_display_name_effective = (
(var.project_display_name != null ? trimspace(var.project_display_name) : "") != ""
? trimspace(var.project_display_name)
: "project-${local.name_raw}"
)

public_network_access = var.public_network_access_enabled ? "Enabled" : "Disabled"
}

resource "azapi_resource" "foundry_account" {
# Use the newer api-version so Foundry-specific properties (like allowProjectManagement)
# are recognized by the resource provider. Schema validation is disabled to avoid
# AzAPI embedded schema lagging the service.
type = "Microsoft.CognitiveServices/accounts@2025-06-01"
schema_validation_enabled = false
name = local.name_raw
location = var.location
parent_id = azapi_resource.resource_group.id

identity {
type = var.enable_system_assigned_identity ? "SystemAssigned" : "None"
}

body = jsonencode({
kind = "AIServices"
properties = {
allowProjectManagement = var.allow_project_management
customSubDomainName = local.custom_subdomain_name_effective
publicNetworkAccess = local.public_network_access
disableLocalAuth = false
dynamicThrottlingEnabled = false
restrictOutboundNetworkAccess = false
}
sku = {
name = var.sku_name
}
tags = var.tags
})

response_export_values = ["*"]

depends_on = [
azapi_resource.resource_group
]
}

resource "azapi_resource" "foundry_project" {
count = var.create_project ? 1 : 0

# The projects subresource may not have schema coverage in AzAPI; disable schema validation.
type = "Microsoft.CognitiveServices/accounts/projects@2025-06-01"
schema_validation_enabled = false
name = local.project_name_effective
location = var.location
parent_id = azapi_resource.foundry_account.id

identity {
type = "SystemAssigned"
}

body = jsonencode({
properties = {
displayName = local.project_display_name_effective
description = var.project_description
}
tags = var.tags
})

response_export_values = ["*"]

depends_on = [
azapi_resource.foundry_account
]
}
29 changes: 29 additions & 0 deletions 8_ai-ml/ai-foundry/outputs.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
output "resource_group_id" {
description = "The resource ID of the Resource Group."
value = azapi_resource.resource_group.id
}

output "foundry_account_id" {
description = "The resource ID of the Foundry account (Cognitive Services account kind AIServices)."
value = azapi_resource.foundry_account.id
}

output "foundry_account_name" {
description = "The name of the Foundry account."
value = azapi_resource.foundry_account.name
}

output "foundry_account_endpoint" {
description = "The endpoint of the Foundry account (when available in the resource properties)."
value = try(jsondecode(azapi_resource.foundry_account.output).properties.endpoint, null)
}

output "foundry_project_id" {
description = "The resource ID of the Foundry project (if created)."
value = try(azapi_resource.foundry_project[0].id, null)
}

output "foundry_project_name" {
description = "The name of the Foundry project (if created)."
value = try(azapi_resource.foundry_project[0].name, null)
}
35 changes: 35 additions & 0 deletions 8_ai-ml/ai-foundry/provider.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
terraform {
required_version = ">= 1.8, < 2.0"

required_providers {
azurerm = {
source = "hashicorp/azurerm"
version = "~> 3.116"
}

azapi = {
source = "Azure/azapi"
version = "~> 1.13"
}

random = {
source = "hashicorp/random"
version = "~> 3.6"
}
}
}

provider "azurerm" {
features {
resource_group {
prevent_deletion_if_contains_resources = false
}
}

# Uses the current Azure CLI context (az login + az account set)
skip_provider_registration = false
}

provider "azapi" {
# Uses the current Azure CLI context (az login + az account set)
}
20 changes: 20 additions & 0 deletions 8_ai-ml/ai-foundry/terraform.tfvars
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
resource_group_name = "rg-ai-foundry-dev"
location = "eastus"

append_random_suffix = true
random_suffix_length = 6

foundry_account_name = "aifoundry-dev"
sku_name = "S0"
allow_project_management = true
public_network_access_enabled = true
enable_system_assigned_identity = true

create_project = true
project_description = ""

tags = {
env = "dev"
area = "ai-ml"
iac = "terraform"
}
Loading