An Azure service that provides customers with a serverless container experience.
Thanks for reaching out Q/A, it looks like you're running into an issue with creating an Azure Container Instance (ACI) that pulls images from a private Azure Container Registry (ACR) using a User-Assigned Managed Identity (UAMI). The "InaccessibleImage" error can be a bit tricky. Here are some things to keep in mind and steps you can take to troubleshoot:
- Role Assignment: Ensure that your User-Assigned Managed Identity has the
AcrPullrole assigned to the correct ACR scope. From your command, it seems you've set this up, but it might be worth double-checking that the role is correctly associated with the right<principal-id>and the ACR resource ID. - Managed Identity Configuration: Make sure that the User-Assigned Managed Identity is correctly attached to the ACI. In your Terraform config, it looks like you are doing this correctly: identity { type = "UserAssigned" identity_ids = [data.azurerm_user_assigned_identity.acr_pull.id]
- Private DNS Zone: If your ACR is behind a private endpoint, ensure that your ACI can resolve the DNS for the private endpoint. This might require proper networking setup.
- Image Availability: Since you confirmed that the image exists in ACR, double-check the image name and tag you're referencing is correct.
- Deploying using the right API version: Ensure you're using an appropriate ACI API version that supports managed identity for authentication (2021-07-01 or later).
For more detailed guidance, please find below documentations.
- How to use managed identities with Azure Container Instances
- Troubleshoot common issues in Azure Container Instances
- Deploying to ACI using managed identities
Hope this helps! Please let me know if you have any queries.