terraform-azurerm-caf icon indicating copy to clipboard operation
terraform-azurerm-caf copied to clipboard

Bug report-Function app fails to use SystemAssigned identity

Open lukaszgx opened this issue 2 years ago • 1 comments

Is there an existing issue for this?

  • [X] I have searched the existing issues

Community Note

  • Please vote on this issue by adding a :thumbsup: 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

Version of the module you are using

azurerm 5.4.8

Rover Version

aztfmod/rover:1.0.1-2106.3012

Terraform Version

1.0.1

AzureRM Provider Version

No response

Affected Resource(s)/Data Source(s)

azurerm_5.4.8

Terraform Configuration Files

function_apps = {
  func_test1 = {
    ### Basic settings here

    identity = {
      type = "SystemAssigned"
    }
  }
}

Expected Behaviour

There seems to be a problem with Function app module. Function app supports both UserAssigned MI and SystemAssigned MI but the module seems to have problem with SystemAssigned.

Expected behavior in this situation would be creation of system assigned MI. I understand that I use outdated version but the module code for identity is the same in both so it seems that the problem is still there.

Actual Behaviour

Terraform:

│ Error: Not enough list items │ │ with module.solution.module.function_apps["func_test1"].azurerm_function_app.function_app, │ on /home/vscode/.terraform.cache/modules/solution/modules/webapps/function_app/module.tf line 12, in resource "azurerm_function_app" "function_app": │ 12: resource "azurerm_function_app" "function_app" { │ │ Attribute requires 1 item minimum, but config has only 0 declared. ╵

Steps to Reproduce

No response

Important Factoids

No response

References

No response

lukaszgx avatar Aug 18 '22 17:08 lukaszgx

hi @lukaszgx - this feature has been added in 5.5.1 as per: https://github.com/aztfmod/terraform-azurerm-caf/releases/tag/5.5.1 so I recommend thast you update to at least that version or cherry pick the feature in your fork depending on your operating model.

arnaudlh avatar Aug 25 '22 07:08 arnaudlh