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
8 changes: 7 additions & 1 deletion .github/workflows/infrastructure.yml
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,13 @@ jobs:

terraform plan -out tfplan "${TF_VARS[@]}"

if terraform apply -auto-approve tfplan 2>&1 | tee /tmp/tf_apply.log; then
# Capture Terraform's exit code via PIPESTATUS — the pipe through
# `tee` otherwise reports tee's (success) status and masks a failed
# apply, which can leave the environment partially destroyed while
# the job reports success.
terraform apply -auto-approve tfplan 2>&1 | tee /tmp/tf_apply.log
apply_rc=${PIPESTATUS[0]}
if [ "$apply_rc" -eq 0 ]; then
echo "✅ Terraform apply succeeded"
break
fi
Expand Down
11 changes: 11 additions & 0 deletions infra/terraform/network.tf
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,17 @@ resource "azurerm_subnet" "container_apps" {
resource_group_name = azurerm_resource_group.rg.name
virtual_network_name = azurerm_virtual_network.vnet[0].name
address_prefixes = [var.container_apps_subnet_prefix]

# Container App Environments require the infrastructure subnet to be
# delegated to Microsoft.App/environments, otherwise creation fails with
# ManagedEnvironmentSubnetDelegationError (400).
delegation {
name = "Microsoft.App.environments"
service_delegation {
name = "Microsoft.App/environments"
actions = ["Microsoft.Network/virtualNetworks/subnets/join/action"]
}
}
}

# Subnet for Private Endpoints
Expand Down
Loading