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.6k stars 4.64k forks source link

azurerm_windows_function_app creation fails when using storage_uses_managed_identity argument #15627

Open kiranpradeep opened 2 years ago

kiranpradeep commented 2 years ago

Community Note

Terraform (and AzureRM Provider) Version

Terraform Configuration Files


resource "azurerm_app_service_plan" "functionappplan" {
  name                = var.functionappplan
  location            = azurerm_resource_group.this.location
  resource_group_name = azurerm_resource_group.this.name
  kind                = "functionapp"

  sku {
    tier = "Dynamic"
    size = "Y1"
  }
}

resource "azurerm_windows_function_app" "monitor" {
  name                          = "example-dev-dfg"
  location                      = azurerm_resource_group.this.location
  resource_group_name           = azurerm_resource_group.this.name
  service_plan_id               = azurerm_app_service_plan.functionappplan.id
  storage_account_name          = azurerm_storage_account.funcstorage.name
  storage_uses_managed_identity = true
  https_only                    = true

  identity {
    type = "SystemAssigned"
  }

  site_config {
  }
}

Description / Feedback

The error code is BadRequest/01019 and error message is invalid values supplied for azure file related app settings. If I use storage_account_access_key instead of storage_uses_managed_identity, the resource creation succeeds

win_fun_fail

References

xiaxyi commented 2 years ago

@kiranpradeep As this docs mentioned, the connection string is required for consumption plan: image

https://docs.microsoft.com/en-us/azure/azure-functions/functions-app-settings#website_contentazurefileconnectionstring

rcskosir commented 1 year ago

Thanks for taking the time to submit this issue. It looks like this has been resolved with @xiaxyi's comment. As such, I am going to mark this issue as closed.

kiranpradeep commented 1 year ago

@rcskosir No. The comment didn't answer the issue. Please reopen.

rcskosir commented 1 year ago

Thank you for the quick response, I have reopened this issue.

beiwubinjue commented 1 month ago

I am also facing same issue, wonder if any solution? I created using arm template and contentshare connection string is created based on this guidance https://learn.microsoft.com/en-us/azure/azure-functions/functions-identity-based-connections-tutorial#create-a-function-app-that-uses-key-vault-for-necessary-secrets

CarlosJoseChaconChavarria commented 1 month ago

do you have a fix for this issue? I am facing the same The data is not valid (Invalid values supplied for Azure Files related app settings.) using bicep