Open penfold opened 1 year ago
I think this issue is a bug as I don't have an issue when I run the equivalent call in powershell:
az containerapp registry set -n ca-test-dev-sprint -g pm-rg-development-pjl --server my-company.azurecr.io --identity /subscriptions/xxxxxxxxxxx/resourceGroups/rg-development-pjl/providers/Microsoft.ManagedIdentity/userAssignedIdentities/cae-development-pjl-registry-identity
A look at the Azure Portal seems to suggest that a UserAssigned identity needs to be added to the Container's identities first and then referenced again in the Registry.Identity field.
Changing the resource.Identity field to:
identity { type = "UserAssigned" identity_ids = [azurerm_user_assigned_identity.uai.id] }
Works.
But I need SystemAssigned identity as well. Therefore, I'm reliant on fix for: https://github.com/hashicorp/terraform-provider-azurerm/issues/20437
Please can the docs for the Registry.Identity be updated to reflect that the Identity must be declared elsewhere and this is just a reference/lookup.
Hey @penfold, I am currently having the same issue with the container app being unable to find the managed identity, but your fix unfortunately does not work. I add the user assigned identity to the container app, but it still is unable to use the identity towards the registry, it seems.
@Peder2911 check out this issue https://github.com/microsoft/azure-container-apps/issues/1233#issuecomment-2276963439 I found that you need to set the fully qualified id in the registry block.
Is there an existing issue for this?
Community Note
Terraform Version
1.3.9
AzureRM Provider Version
3.45
Affected Resource(s)/Data Source(s)
azurerm_container_app
Terraform Configuration Files
Debug Output/Panic Output
Expected Behaviour
The container registry should be setup to access via the identity.
Actual Behaviour
It is unable to find the user assigned identity that was just created.
Steps to Reproduce
No response
Important Factoids
No response
References
https://github.com/hashicorp/terraform-provider-azurerm/pull/20466