CodexBloom - Programming Q&A Platform

Terraform scenarios to provision Azure Function with 'Conflict' scenarios despite correct configuration

👀 Views: 41 đŸ’Ŧ Answers: 1 📅 Created: 2025-06-01
terraform azure azure-functions HCL

I'm stuck trying to I'm wondering if anyone has experience with Could someone explain I'm getting frustrated with I've been struggling with this for a few days now and could really use some help....... I'm working on a personal project and I tried several approaches but none seem to work... I'm trying to provision an Azure Function using Terraform, but I'm working with a 'Conflict' behavior when applying my changes. The behavior message indicates that the function app already exists, even though I've specified a unique name. I'm using Terraform version 1.3.6 and the Azure Provider version 2.85.0. Here's a snippet of my Terraform configuration: ```hcl provider "azurerm" { features {} } resource "azurerm_resource_group" "example" { name = "example-resources" location = "East US" } resource "azurerm_storage_account" "example" { name = "examplestoracc" # Unique name resource_group_name = azurerm_resource_group.example.name location = azurerm_resource_group.example.location account_tier = "Standard" account_replication_type = "LRS" } resource "azurerm_function_app" "example" { name = "example-function-app" # Unique name location = azurerm_resource_group.example.location resource_group_name = azurerm_resource_group.example.name app_service_plan_id = azurerm_app_service_plan.example.id storage_account_name = azurerm_storage_account.example.name version = "~3" os_type = "linux" } ``` I've ensured that both the storage account and function app names are unique across Azure. I even tried destroying and recreating the resource group, but the scenario continues. When checking the Azure portal, I don't see any existing resources with the same name. Has anyone else faced this scenario? What could be causing the conflict, and how can I resolve it? My development environment is Linux. Any ideas what could be causing this? Any pointers in the right direction? This is for a web app running on Debian. What would be the recommended way to handle this? I'm on CentOS using the latest version of Hcl. I appreciate any insights! Thanks for any help you can provide!