Unable to destroy storage account created with Private link (context deadline exceeded)

I am creating storage account with containers and private link option. When i try to destroy it is giving error like below…

Error: retrieving Container "deletee" (Account "stazue2deleteeb5" / Resource Group "r-deletee-y6e0-dev"): containers.Client#GetProperties: Failure sending request: StatusCode=0 -- Original Error: context deadline exceeded

if i remove the block for adding private link, i am able to destroy. What could be the issue?

resource "azurerm_storage_account" "abc_storage_account" {
// code here
}

module "private_endpoint" {
   
  resource_id       = azurerm_storage_account.abc_storage_account.id
  resource_name     = "sta-${var.storage_account}"
  metadata          = var.metadata
  subnet_id         = var.private_endpoint_subnet
  rg_name           = data.azurerm_resource_group.abc_resource_group[0].name
  subresource_names = [var.private_endpoint_target_sub_resource]
  tags              = module.tags.map
}

resource "azurerm_storage_container" "abc_storage_account_container" {
  
  count                 = length(local.containers)
  name                  = local.containers[count.index]
  storage_account_name  = azurerm_storage_account.abc_storage_account.name
  container_access_type = var.container_access
}


resource "azurerm_storage_account_network_rules" "netrules" {
  
  storage_account_id = azurerm_storage_account.abc_storage_account.id

  default_action             = var.network_rule_default_action
  ip_rules                   = var.storage_allowed_cidrs
  virtual_network_subnet_ids = concat(var.aks_subnet_ids, local.subnets)

  depends_on = [
    azurerm_storage_container.abc_storage_account_container
  ]
}
1 Like

hi @venrass
im facing the exact same issue, just wondering if you found a fix ?