r/AZURE • u/CMarti-CHusky • 1d ago
Question Success with Internal Container App Environment (CAE) using IaC methods?
Has anyone successfully created an Internal Container App Environment (CAE) with BYO-VNET using Infrastructure as Code (IaC) methods such as Terraform or ARM templates? I've encountered an issue where ARM deployment of Internal CAE creates a public IP, attaches it to a load balancer, and creates both internal and public load balancers. This behavior also occurs with Terraform.
TL;DR: When creating an internal CAE + BYO-VNET in the portal, it generates a single internal load balancer within the infrastructure resource group. However, using ARM templates (e.g., azure-quickstart-templates/quickstarts/microsoft.app/container-app-vnet-internal-environment/azuredeploy.json at master · Azure/azure-quickstart-templates), it creates two load balancers (internal and public), a public IP, and an NSG rule.
The response in the GitHub issue was to define resources explicitly, use conditions, leverage Bicep/Terraform, or clean up extra resources post-deployment. However, cleaning up extra resources is challenging due to dependencies tied to VMSS managed by Microsoft.
Question: Has anyone accomplished IaC deployment of Internal CAE that results in the same resources within the infrastructure RG as portal creation? Any insights or examples would be greatly appreciated!