Terraform AzureRM: 3.27.0
Using azurerm_logic_app_standard to create a standard logic app.
The logic app is getting created but it is not associating the User Assigned Managed Identity provided in the Identity Block.
code block:
identity {
identity_ids = [azurerm_user_assigned_identity.logicapp-uami.id]
type = "SystemAssigned, UserAssigned"
}
No error reported.
Terraform Log:
*+ identity {*
+ identity_ids = (known after apply)*
+ principal_id = (known after apply)*
+ tenant_id = (known after apply)*
+ type = "SystemAssigned, UserAssigned"*
}*
When checked in Azure Portal , it doesn’t show the User assigned managed identity in Logic App. Only System Assigned Identity is enabled.
Manually I can add User assigned Identity to same app without any issue.
Issue was discussed on Github and says it’s Resolved, but I am getting the same result that you show above.
opened 04:10PM - 09 May 22 UTC
enhancement
service/logic
### Is there an existing issue for this?
- [X] I have searched the existing i… ssues
### Community Note
* Please vote on this issue by adding a :thumbsup: [reaction](https://blog.github.com/2016-03-10-add-reactions-to-pull-requests-issues-and-comments/) 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 Version
1.1.7
### AzureRM Provider Version
2.99.0
### Affected Resource(s)/Data Source(s)
azurerm_logic_app_standard
### Terraform Configuration Files
```hcl
resource "azurerm_user_assigned_identity" "mi" {
name = logicapp-test-mi"
location = data.azurerm_resource_group.rg.location
resource_group_name = data.azurerm_resource_group.rg.name
}
resource "azurerm_logic_app_standard" "logicapp" {
name = "logicapp-test"
location = data.azurerm_resource_group.rg.location
resource_group_name = data.azurerm_resource_group.rg.name
app_service_plan_id = azurerm_app_service_plan.svcplan.id
storage_account_name = azurerm_storage_account.sa.name
storage_account_access_key = azurerm_storage_account.sa.primary_access_key
identity {
type = "UserAssigned"
principal_id = azurerm_user_assigned_identity.mi.id
}
}
```
### Debug Output/Panic Output
```shell
Terraform APPLY...
Error: expected identity.0.type to be one of [SystemAssigned], got UserAssigned
with module.tf-az-logicapps.azurerm_logic_app_standard.logicapp on .terraform\modules\logicapps\main.tf line 81, in resource "azurerm_logic_app_standard" "logicapp":
81: type = "UserAssigned"
----------------------
Error: Value for unconfigurable attribute
with module.logicapps.azurerm_logic_app_standard.logicapp, on .terraform\modules\logicapps\main.tf line 82, in resource "azurerm_logic_app_standard" "logicapp":
82: principal_id = azurerm_user_assigned_identity.mi.id
Can't configure a value for "identity.0.principal_id": its value will be
decided automatically based on the result of applying this configuration.
```
### Expected Behaviour
Azure Standard Logic App support associating an user-assigned managed identity.

The user-assignment managed identity is associated to the standard logic app using the identity block.
```
resource "azurerm_logic_app_standard" "logicapp" {
name = "logicapp-test"
location = data.azurerm_resource_group.rg.location
resource_group_name = data.azurerm_resource_group.rg.name
app_service_plan_id = azurerm_app_service_plan.svcplan.id
storage_account_name = azurerm_storage_account.sa.name
storage_account_access_key = azurerm_storage_account.sa.primary_access_key
**identity {
type = "UserAssigned"
principal_id = azurerm_user_assigned_identity.mi.id
}**
}
```
### Actual Behaviour
Error: expected identity.0.type to be one of [SystemAssigned], got UserAssigned
with module.tf-az-logicapps.azurerm_logic_app_standard.logicapp on .terraform\modules\logicapps\main.tf line 81, in resource "azurerm_logic_app_standard" "logicapp":
81: type = "UserAssigned"
----------------------
Error: Value for unconfigurable attribute
with module.logicapps.azurerm_logic_app_standard.logicapp, on .terraform\modules\logicapps\main.tf line 82, in resource "azurerm_logic_app_standard" "logicapp":
82: principal_id = azurerm_user_assigned_identity.mi.id
Can't configure a value for "identity.0.principal_id": its value will be
decided automatically based on the result of applying this configuration.
### Steps to Reproduce
_No response_
### Important Factoids
_No response_
### References
_No response_