Reference to System-Assigned vs User-Assigned Managed Identities

Hi all,

I am trying to help someone with their Terraform configuration. This requires the use of a user-assigned managed identity as well as a system-assigned one, in order to work with specific resources (this is basically a 3rd party app that is being deployed).

I have deployed an azurerm_linux_web_app and specified to use both system and user-assigned identities:


I am having trouble getting a key vault access policy deployed, using the system-assigned ID as the object_id; at this time, having tried lots of different variations on this theme, my code has:

Whatever I do, I keep getting the error:

*Error: expected “object_id” to be a valid UUID, got *
*│ *
│ with module.statusnotifier-infra.azurerm_key_vault_access_policy.app_service_access_policy,
│ on …\modules\my-app\ line 42, in resource “azurerm_key_vault_access_policy” “app_service_access_policy”:
│ 42: object_id = azurerm_linux_web_app.this.identity.0.principal_id

Please can someone provide some insight into how I should be referring to the system-assigned identity?