Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Azurerm_function_app version 3 adds an unsupported app config #8432

Open
ManuSQLGeek opened this issue Sep 11, 2020 · 3 comments
Open

Azurerm_function_app version 3 adds an unsupported app config #8432

ManuSQLGeek opened this issue Sep 11, 2020 · 3 comments

Comments

@ManuSQLGeek
Copy link

ManuSQLGeek commented Sep 11, 2020

Community Note

  • Please vote on this issue by adding a 馃憤 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Terraform (and AzureRM Provider) Version

Affected Resource(s)

  • azurerm_function_app

Terraform Configuration Files

  name                       = var.function_app_name
  resource_group_name        = var.resource_group_name
  location                   = var.location
  app_service_plan_id        = azurerm_app_service_plan.app_service_plan.id
  storage_account_name       = azurerm_storage_account.function_app_sa.name
  storage_account_access_key = azurerm_storage_account.function_app_sa.primary_connection_string
  version                    = "~3"
  app_settings                 = {
    FUNCTIONS_WORKER_RUNTIME = "dotnet"
  }
  site_config {
    always_on                = true
  }
  identity {
      type = "SystemAssigned"
  }
  tags                       = local.tags
}

Debug Output

Panic Output

Expected Behavior

When we specify version = "~3" the app should not have a app config value set for AzureWebJobsDashboard.

According to Microsoft documentation (https://docs.microsoft.com/en-us/azure/azure-functions/functions-app-settings#azurewebjobsdashboard) this is a valid setting only for version 1.

Actual Behavior

The deployment is adding the config value for AzureWebJobsDashboard setting under configuration which is leaving the function app in a runtime error state.

![Annotation 2020-09-10 102556](https://user-images.githubusercontent.com/7800452/92834835-d7cd3400-f41d-11ea-9386-8e79449c0f8b.png)

Steps to Reproduce

  1. terraform apply

Important Factoids

References

  • #0000
@JeremyBouchet
Copy link

Hello,

I encounter the same issue.

I must deploy an Azure Function with the runtime version 3 and I encounter the below error :
"
Error: web.AppsClient#CreateOrUpdate: Failure sending request: StatusCode=0 -- Original Error: Code="BadRequest" Message="The storage URI is invalid." Details=[{"Message":"The storage URI is invalid."},{"Code":"BadRequest"},{"ErrorEntity":{"Code":"BadRequest","ExtendedCode":"04203","Message":"The storage URI is invalid.","MessageTemplate":"The storage URI is invalid.","Parameters":["Duplicate setting 'AccountName' found."]}}]
"
My Terraform code

resource "azurerm_function_app" "AF-Core-steps" {
  name                        = "AF-${var.client}-${var.environment}-${var.project_Flux}-IT-CORE-steps"
  location                    = module.resource_group_CORE.out_rg_location
  resource_group_name         = module.resource_group_CORE.out_rg_name
  app_service_plan_id         = azurerm_app_service_plan.ASP-Core.id
  https_only                  = "true"
  version                     = "~3"
  storage_account_name        = module.storage_account_CORE.out_storage_account_name
  storage_account_access_key  = module.storage_account_CORE.out_storage_primary_connection_string
  tags                        = merge(var.default_tags, var.default_Core_tags, var.AF-Core-steps_tags)

 lifecycle {
    ignore_changes = all
  }
}

Is anyone find a solution to deploy Function App with the runtime version 3 with Terraform ?

regards,

@rohit-prakash
Copy link

Hi,

I am specifying the version in app_settings and its working for me

My code

resource "azurerm_function_app" "this" {
name = azurecaf_name.function_app.result
location = var.location
resource_group_name = azurerm_resource_group.app.name
app_service_plan_id = module.appserviceplan.id
storage_account_name = azurerm_storage_account.this.name
storage_account_access_key = azurerm_storage_account.this.primary_access_key
os_type = "linux"
version = "~3"
site_config {
linux_fx_version = "DOTNET|3.1"
}
app_settings = {
FUNCTIONS_EXTENSION_VERSION = "~3"
}
identity {
type = "SystemAssigned"
}
}

@drdamour
Copy link
Contributor

drdamour commented Oct 7, 2022

this should apply to any version that is not ~1, so should omit for ~4 as well. It logs a warning if it's set per Azure/Azure-Functions#1923

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants