performance - Azure Container App Environment deletion takes over 20 minutes – Is this normal, and how can it be optimized? - St

I'm experiencing unusually long delays when managing an Azure Container App Environment (ACA Envir

I'm experiencing unusually long delays when managing an Azure Container App Environment (ACA Environment), both when deleting it through Terraform and the Azure Portal. Specifically, deleting the ACA Environment consistently takes more than 20 minutes. This seems strange because the associated resources (such as virtual networks and subnets) are relatively simple.

Here’s a simplified version of my Terraform configuration:

resource "azurerm_virtual_network" "virtual_network" {
  name                = "vnet-${var.environment}-${var.location}-001"
  address_space       = ["10.0.0.0/16"]
  location            = var.location
  resource_group_name = azurerm_resource_group.resource_group.name

  tags = local.global_tags
}

resource "azurerm_subnet" "apis_subnet" { 
  name                 = "snet-apis-${var.location}-001"
  resource_group_name  = azurerm_resource_group.resource_group.name
  virtual_network_name = azurerm_virtual_network.virtual_network.name
  address_prefixes     = ["10.0.1.0/24"]

  delegation {
    name = "delegation"
    service_delegation {
      name    = "Microsoft.App/environments"
      actions = ["Microsoft.Network/virtualNetworks/subnets/join/action"]
    }
  }

  lifecycle {
    prevent_destroy = false
    ignore_changes  = [address_prefixes]
  }
}

resource "azurerm_container_app_environment" "container_app_environment" { 
  name                = "cae-something-${var.location}-${var.environment}-001"
  location            = var.location
  resource_group_name = azurerm_resource_group.resource_group.name

  infrastructure_subnet_id = azurerm_subnet.apis_subnet.id

  workload_profile {
    name                  = "Consumption"
    workload_profile_type = "Consumption"
  }
}

What I've Observed

  1. Deleting the ACA Environment through Terraform or the Azure Portal takes over 20 minutes.
  2. Resources such as virtual networks and subnets are typically faster to manage, so this delay seems unexpected.

What I Want to Know

  1. Is it normal for Azure Container App Environments to take this long to delete?
  2. Are there any known best practices or optimizations to reduce this time?
  3. Could this delay be related to dependencies or configurations (e.g., the workload profile or subnet delegation)?

If you’ve run into something similar or have ideas on what might be causing this, I’d really appreciate your help!

I'm experiencing unusually long delays when managing an Azure Container App Environment (ACA Environment), both when deleting it through Terraform and the Azure Portal. Specifically, deleting the ACA Environment consistently takes more than 20 minutes. This seems strange because the associated resources (such as virtual networks and subnets) are relatively simple.

Here’s a simplified version of my Terraform configuration:

resource "azurerm_virtual_network" "virtual_network" {
  name                = "vnet-${var.environment}-${var.location}-001"
  address_space       = ["10.0.0.0/16"]
  location            = var.location
  resource_group_name = azurerm_resource_group.resource_group.name

  tags = local.global_tags
}

resource "azurerm_subnet" "apis_subnet" { 
  name                 = "snet-apis-${var.location}-001"
  resource_group_name  = azurerm_resource_group.resource_group.name
  virtual_network_name = azurerm_virtual_network.virtual_network.name
  address_prefixes     = ["10.0.1.0/24"]

  delegation {
    name = "delegation"
    service_delegation {
      name    = "Microsoft.App/environments"
      actions = ["Microsoft.Network/virtualNetworks/subnets/join/action"]
    }
  }

  lifecycle {
    prevent_destroy = false
    ignore_changes  = [address_prefixes]
  }
}

resource "azurerm_container_app_environment" "container_app_environment" { 
  name                = "cae-something-${var.location}-${var.environment}-001"
  location            = var.location
  resource_group_name = azurerm_resource_group.resource_group.name

  infrastructure_subnet_id = azurerm_subnet.apis_subnet.id

  workload_profile {
    name                  = "Consumption"
    workload_profile_type = "Consumption"
  }
}

What I've Observed

  1. Deleting the ACA Environment through Terraform or the Azure Portal takes over 20 minutes.
  2. Resources such as virtual networks and subnets are typically faster to manage, so this delay seems unexpected.

What I Want to Know

  1. Is it normal for Azure Container App Environments to take this long to delete?
  2. Are there any known best practices or optimizations to reduce this time?
  3. Could this delay be related to dependencies or configurations (e.g., the workload profile or subnet delegation)?

If you’ve run into something similar or have ideas on what might be causing this, I’d really appreciate your help!

Share Improve this question asked Jan 17 at 17:56 Tiago FerreiraTiago Ferreira 211 bronze badge 0
Add a comment  | 

1 Answer 1

Reset to default 0

Azure Container App Environment deletion takes over 20 minutes – Is this normal, and how can it be optimized?

The Azure Container App Environment takes a longer time for resource creation and deletion, typically when the associated resources (like the VNet and subnet) are simple configurations. Deletion times can vary depending on several factors, such as the presence of active workloads, network configurations, or Azure platform performance at the time.

Terraform also gives a default of 30 minutes to delete an Azure Container App. Follow the link for more details

Even when I tried to delete the ACA using Terraform, it took 21 minutes to delete.

To better understand what Terraform is doing during the deletion process, enable Terraform debugging

$env:TF_LOG="DEBUG"
terraform destroy

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745350510a4623803.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信