I'm getting an Internal Server Error when viewing secrets of a Container App

Juliano Penna 0 Reputation points
2024-09-27T00:58:11.7433333+00:00

Hello,

I'm getting an error when trying to view the secrets of a container app:

"Internal server error occurred. correlation ID: ec622823-714f-49c8-8fb3-27fcace17443"

I'm also getting an error when trying to run terraform import for this same container. It gets stuck when "retrieving secrets":

module.backend_container_app.azurerm_container_app.backend: Importing from ID "/subscriptions/00000000000000000/resourceGroups/1111111111111/providers/Microsoft.App/containerApps/22222222222222"...
module.backend_container_app.azurerm_container_app.backend: Import prepared!
  Prepared azurerm_container_app for import
module.backend_container_app.azurerm_container_app.backend: Refreshing state... [id=/subscriptions/00000000000000000/resourceGroups/1111111111111/providers/Microsoft.App/containerApps/22222222222222]
data.azurerm_1111111111111.rs: Read complete after 0s [id=/subscriptions/00000000000000000/resourceGroups/1111111111111]
│ Error: retrieving secrets for Container App (Subscription: "00000000000000000"
│ Resource Group Name: "1111111111111"
│ Container App Name: "22222222222222"): Post "https://management.azure.com/subscriptions/00000000000000000/resourceGroups/1111111111111/providers/Microsoft.App/containerApps/22222222222222/listSecrets?api-version=2023-05-01": context deadline exceeded
│ 
│ retrieving secrets for Container App (Subscription: "00000000000000000"
│ Resource Group Name: "1111111111111"
│ Container App Name: "22222222222222"): Post
│ "https://management.azure.com/subscriptions/00000000000000000/resourceGroups/1111111111111/providers/Microsoft.App/containerApps/22222222222222/listSecrets?api-version=2023-05-01": context deadline
│ exceeded
╵

Releasing state lock. This may take a few moments...


I imagine what I am doing wrong or if it is an issue in Azure...

Azure Key Vault
Azure Key Vault
An Azure service that is used to manage and protect cryptographic keys and other secrets used by cloud apps and services.
1,282 questions
Azure Container Apps
Azure Container Apps
An Azure service that provides a general-purpose, serverless container platform.
419 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Andriy Bilous 11,421 Reputation points MVP
    2024-09-30T20:29:57.32+00:00

    Hello Juliano Penna

    Try following troubleshooting steps:

    1. Ensure correct permissions for the identity accessing the secrets.
      Managed Identity or Service Principal running Terraform should have the correct permissions to retrieve secrets from the Container App. You may need Microsoft.App/containerApps/listSecrets/action permission, which is part of the Contributor or Container App Operator roles.
    2. Verify Key Vault integration and API version compatibility.
    3. Retry or break down the Terraform import into smaller steps.

    I would also recommend to look if there are no opened bugs in azurerm terraform provider.
    https://github.com/hashicorp/terraform-provider-azurerm/issues/22432

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.