microsoft / azure-container-apps

Roadmap and issues for Azure Container Apps
MIT License
370 stars 29 forks source link

Azure Container App fails to load with user assigned managed identity #1289

Closed kamalsivalingam closed 1 month ago

kamalsivalingam commented 1 month ago

Please provide us with the following information:

This issue is a: (mark with an x)

Issue description

We are working on moving to Azure Container Apps from Azure Container Instances. While we are trying to reuse the same docker-compose file, I have been running into issues trying to bootstrap the .NET Core Web API container. Earlier i was getting error related to managed identity - Service request failed. Unable to load the proper Managed Identity

We are using user assigned managed identity and I found another github issue where someone mentioned we had to set environment variable for AZURE_CLIENT_ID with the user managed identity's Client Id.

While that error is now resolved, the Web API container app is still not starting up. Looking into console, i just see this Probe Failed error. {"TimeStamp":"2024-09-19 22:07:26 \u002B0000 UTC","Type":"Warning","ContainerAppName":"clinic-api-pr-158","RevisionName":"clinic-api-pr-158--nh7bwes","ReplicaName":"clinic-api-pr-158--nh7bwes-5dcc7674cb-dcgd7","Msg":"Probe with executor TcpExecutor failed with status code: 1","Reason":"ProbeFailed","EventSource":"ContainerAppController","Count":1039}

I do not see any other error in the logs. Could you please let me know what could be issue? Is there any other troubleshooting technique/tips?

Steps to reproduce

  1. ..
  2. ..

Expected behavior [What you expected to happen.]

Actual behavior [What actually happened.]

Screenshots
If applicable, add screenshots to help explain your problem.

Additional context

Ex. Did this issue occur in the CLI or the Portal?

kamalsivalingam commented 1 month ago

Is liveness probe mandatory for the container apps to work?

anthonychu commented 1 month ago

If you don’t define any probes, default probes are created for you using the target port you configured on the ingress. Can you confirm the container is listening to the target port?

kamalsivalingam commented 1 month ago

Thanks @anthonychu. I had created this issue earlier and i think it might have been an internal connection to DB container. So I ended up creating a simple .net core web api with just in memory cache and no other dependences. While the API container seems to be up, the Dapr container keeps crashing. I created a separate Github issue for that: https://github.com/microsoft/azure-container-apps/issues/1297

simonjj commented 1 month ago

@kamalsivalingam, sounds like the TCP probe clarity has resolved this issue. Can we close this issue now or do you still need help?

kamalsivalingam commented 1 month ago

@simonjj Following were the fixes i had to make to get this working: