hashicorp / terraform-provider-azurerm

Terraform provider for Azure Resource Manager
https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs
Mozilla Public License 2.0
4.54k stars 4.61k forks source link

public_network_access_enabled not working on linux_function_app #27555

Open cbell38 opened 5 days ago

cbell38 commented 5 days ago

Is there an existing issue for this?

Community Note

Terraform Version

1.9.7

AzureRM Provider Version

4.3.0

Affected Resource(s)/Data Source(s)

azurerm_linux_function_app

Terraform Configuration Files

resource "azurerm_linux_function_app" "datadog_fa" {
  name                          = "name"
  location                      = var.location
  resource_group_name           = "resource_group_name"
  storage_account_name          = "storage_account_name"
  storage_account_access_key    = "primary_access_key"
  service_plan_id               = "service_plan_id"
  https_only                    = true
  client_certificate_enabled    = true
  client_certificate_mode       = "Required"
  public_network_access_enabled = false
  virtual_network_subnet_id     = "subnet_id"

  site_config {
    always_on = true
    application_stack {
      node_version = "18"
    }
  }

  app_settings = {
    WEBSITE_RUN_FROM_PACKAGE = "0"
  }

  identity {
    type = "SystemAssigned"
  }

  lifecycle {
    ignore_changes = [
      tags
    ]
  }
}

Debug Output/Panic Output

Error: Unsupported argument
on .terraform/modules/dd_integration/dd-logs.tf line 88, in resource "azurerm_linux_function_app" "datadog_fa":
  public_network_access_enabled = false
An argument named "public_network_access_enabled" is not expected here.

Expected Behaviour

Expected behavior is to create the Function App with public network access disabled.

Actual Behaviour

Plan fails with an unsupported argument error.

Steps to Reproduce

terraform apply

Important Factoids

No response

References

No response

Chambras commented 3 days ago

@cbell38 the plan runs without any issues for me. I was looking at your error again and it seems you are using modules? do you have a variable for public_network_access_enabled in your module?

cbell38 commented 5 hours ago

@Chambras yes, the resource block above is essentially what's in the module. the only difference is we pass the name as a variable.