Since I migrate to container sidecar, my app is starting but not responding
Since I migrate to container sidecar, my NestJS app is starting but not responding.
I am not using managed identity but am having this error "ManagedIdentity container failed to startup"
2025-09-02T09:33:17.6038270Z Site container: my-api_managedIdentity terminated during site startup.
2025-09-02T09:33:17.6047041Z ManagedIdentity container failed to startup
2025-09-02T09:33:17.7120551Z Site: my-api will be blocked for 1 minutes till 09/02/2025 09:34:17
2025-09-02T09:33:22.7401533Z Start site prohibitted because the site is being blocked.
2025-09-02T09:33:27.7580393Z Start site prohibitted because the site is being blocked.
2025-09-02T09:33:32.7787782Z Start site prohibitted because the site is being blocked.
In the Log stream, I can see that the app is actually listening even if any curl request is getting a 503.
2025-09-02T10:06:18.0054969Z {"level":30,"time":1756807577996,"pid":1,"hostname":"a78e8edfb95e","msg":"Server listening at http://169.254.134.2:8080"}
Can someone help solve this?
Azure
-
Himanshu Shekhar • 1,350 Points de réputation • Personnel externe Microsoft • Modérateur
2025-09-02T13:49:38.15+00:00 Bonjour Emmanuel GUENOU
Bienvenue sur la plateforme de questions-réponses Microsoft. Merci de votre message et espérons que vous allez bien.
N'hésitez pas à nous aider en répondant aux quelques questions ci-dessous pour résoudre vos problèmes.
Comment le conteneur sidecar est-il configuré pour fonctionner avec votre application NestJS principale ? Partagent-ils le même réseau, les mêmes volumes ou les mêmes variables d'environnement ?
Quel est l'objectif exact du conteneur sidecar ManagedIdentity dans votre configuration, étant donné que vous n'utilisez pas d'identité gérée ?
Pouvez-vous partager l'intégralité des journaux du conteneur principal et du conteneur sidecar ManagedIdentity afin de détecter d'éventuelles erreurs ?
Existe-t-il des sondes de démarrage ou de disponibilité/d'activité configurées qui pourraient entraîner l'absence de réponse de l'application ?
L'application écoute-t-elle sur l'adresse IP et le port attendus, et cette adresse IP est-elle accessible depuis l'endroit où vous envoyez les requêtes ?
Avez-vous testé l'envoi de requêtes au service d'application en interne (au sein du réseau du conteneur) ou en externe pour isoler les problèmes de connectivité ?
Existe-t-il des contraintes de ressources (processeur, mémoire) ou des blocages/restrictions au niveau de la plateforme qui impactent le démarrage du conteneur ?
Avez-vous essayé de supprimer ou de désactiver temporairement le conteneur sidecar ManagedIdentity pour voir si l'application principale devient réactive ?
-
Emmanuel GUENOU • 0 Points de réputation
2025-09-02T23:18:26.1266667+00:00 Bonjour,
Merci pour votre retour. Notez que localement (hors Azure), le backend fonctionne.
Le frontend recevant des réponse HTTP 503, j'ai enlevé temporairement le vnet pour être sûr que ça ne vient pas du réseau.
Pouvons-nous convenir d'une réunion ? Je ne suis pas à l'aise avec le fait de partager des logs sur un forum public.
Voici toutefois la fin des logs du sidecar
2025-09-02T23:11:41.2215635Z [32m[Nest] 1 - [39m09/02/2025, 11:11:41 PM [32m LOG[39m [38;5;3m[NestApplication] [39m[32mNest application successfully started[39m[38;5;3m +93ms[39m 2025-09-02T23:11:41.2812585Z {"level":30,"time":1756854701280,"pid":1,"hostname":"54ea56c24f67","msg":"Server listening at http://127.0.0.1:8080"} 2025-09-02T23:11:41.2818038Z [32m[Nest] 1 - [39m09/02/2025, 11:11:41 PM [32m LOG[39m [32m🚀 Application is running on: http://0.0.0.0:8080/graphql[39m 2025-09-02T23:11:41.2850710Z {"level":30,"time":1756854701281,"pid":1,"hostname":"54ea56c24f67","msg":"Server listening at http://169.254.134.3:8080"}Et celle du log stream (le noms sont masqués)
2025-09-02T23:11:41.2215635Z [32m[Nest] 1 - [39m09/02/2025, 11:11:41 PM [32m LOG[39m [38;5;3m[NestApplication] [39m[32mNest application successfully started[39m[38;5;3m +93ms[39m 2025-09-02T23:11:41.2812585Z {"level":30,"time":1756854701280,"pid":1,"hostname":"54ea56c24f67","msg":"Server listening at http://127.0.0.1:8080"} 2025-09-02T23:11:41.2818038Z [32m[Nest] 1 - [39m09/02/2025, 11:11:41 PM [32m LOG[39m [32m🚀 Application is running on: http://0.0.0.0:8080/graphql[39m 2025-09-02T23:11:41.2850710Z {"level":30,"time":1756854701281,"pid":1,"hostname":"54ea56c24f67","msg":"Server listening at http://169.254.134.3:8080"} 2025-09-02T23:10:59.5946213Z Site container: xxxxxxx-dev_managedIdentity terminated during site startup. 2025-09-02T23:10:59.6009147Z ManagedIdentity container failed to startup 2025-09-02T23:11:31.1188538Z Container start method called. 2025-09-02T23:11:31.1189977Z Establishing network. 2025-09-02T23:11:31.1191167Z Pulling image: yyyyyyy.azurecr.io/ttttttt:latest. 2025-09-02T23:11:33.2553549Z Container is starting. 2025-09-02T23:11:33.2554911Z Establishing user namespace if not established already. 2025-09-02T23:11:33.2555968Z Establishing network if not established already. 2025-09-02T23:11:33.2557148Z Mounting volumes. 2025-09-02T23:11:33.2558568Z Nested mountpoint volatile/logs 2025-09-02T23:11:33.2616637Z Nested mountpoint 2025-09-02T23:11:33.2641687Z Nested mountpoint 2025-09-02T23:11:33.2738104Z Creating container. 2025-09-02T23:11:33.2739835Z Creating pipes for streaming container io. 2025-09-02T23:11:33.2741545Z Creating stdout named pipe at /podr/container/pipe/5f8e0b46b81e_xxxxxxx-dev_xxxxxxx-dev/stdout_24d1f964178e44e2afb53e644e16c26c. 2025-09-02T23:11:33.2745039Z Successfully created stdout named pipe at: /podr/container/pipe/5f8e0b46b81e_xxxxxxx-dev_xxxxxxx-dev/stdout_24d1f964178e44e2afb53e644e16c26c. 2025-09-02T23:11:33.2746859Z Opening named pipe /podr/container/pipe/5f8e0b46b81e_xxxxxxx-dev_xxxxxxx-dev/stdout_24d1f964178e44e2afb53e644e16c26c for reading in non-blocking mode. 2025-09-02T23:11:33.2748874Z Successfully opened named pipe: /podr/container/pipe/5f8e0b46b81e_xxxxxxx-dev_xxxxxxx-dev/stdout_24d1f964178e44e2afb53e644e16c26c. 2025-09-02T23:11:33.2750721Z Successfully removed non-blocking flag from /podr/container/pipe/5f8e0b46b81e_xxxxxxx-dev_xxxxxxx-dev/stdout_24d1f964178e44e2afb53e644e16c26c. 2025-09-02T23:11:33.2752862Z Creating stderr named pipe at /podr/container/pipe/5f8e0b46b81e_xxxxxxx-dev_xxxxxxx-dev/stderr_111cc5f17eb24fa29244224925b1e77a. 2025-09-02T23:11:33.2757407Z Successfully created stderr named pipe at: /podr/container/pipe/5f8e0b46b81e_xxxxxxx-dev_xxxxxxx-dev/stderr_111cc5f17eb24fa29244224925b1e77a. 2025-09-02T23:11:33.2762943Z Opening named pipe /podr/container/pipe/5f8e0b46b81e_xxxxxxx-dev_xxxxxxx-dev/stderr_111cc5f17eb24fa29244224925b1e77a for reading in non-blocking mode. 2025-09-02T23:11:33.2766922Z Successfully opened named pipe: /podr/container/pipe/5f8e0b46b81e_xxxxxxx-dev_xxxxxxx-dev/stderr_111cc5f17eb24fa29244224925b1e77a. 2025-09-02T23:11:33.2770332Z Successfully removed non-blocking flag from /podr/container/pipe/5f8e0b46b81e_xxxxxxx-dev_xxxxxxx-dev/stderr_111cc5f17eb24fa29244224925b1e77a. 2025-09-02T23:11:33.2775186Z Creating container with image: yyyyyyy.azurecr.io/ttttttt:latest from registry: yyyyyyy.azurecr.io and fully qualified image name: yyyyyyy.azurecr.io/ttttttt:latest 2025-09-02T23:11:33.4159882Z Starting container: 5f8e0b46b81e_xxxxxxx-dev_xxxxxxx-dev. 2025-09-02T23:11:33.4345760Z Starting watchers and probes. 2025-09-02T23:11:33.4361242Z Starting metrics collection. 2025-09-02T23:11:33.4365057Z Container is running. 2025-09-02T23:11:33.4797765Z Container start method finished after 2356 ms.Merci d'avance.
-
Emmanuel GUENOU • 0 Points de réputation
2025-09-02T23:19:51.13+00:00 Notez qu'il s'agit d'App Service avec container Docker avec un App Service Plan Premium.
-
Emmanuel GUENOU • 0 Points de réputation
2025-09-02T23:22:20.0266667+00:00 Suite des logs de log stream
http://0.0.0.0:8080/graphql[39m 2025-09-02T23:16:43.6316104Z {"level":30,"time":1756855003626,"pid":1,"hostname":"30a73001ca92","msg":"Server listening at http://169.254.134.3:8080"} 2025-09-02T23:17:49 No new trace in the past 1 min(s). 2025-09-02T23:18:49 No new trace in the past 2 min(s). 2025-09-02T23:19:49 No new trace in the past 3 min(s). 2025-09-02T23:20:25.6665297Z Site startup probe failed after 230.0089242 seconds. 2025-09-02T23:20:25.6825819Z Failed to start site. Revert by stopping site. 2025-09-02T23:20:25.6829601Z Container is terminating. Grace period: 5 seconds. 2025-09-02T23:20:25.6843723Z Stop and delete container. Retry count = 0 2025-09-02T23:20:25.6844628Z Stopping container: c7c07a59bbde_xxxxxxx_xxxxxxx. 2025-09-02T23:20:32.3422268Z Deleting container: c7c07a59bbde_xxxxxxx_xxxxxxx. Retry count = 0 2025-09-02T23:20:32.4276453Z Container spec TerminationMessagePolicy path 2025-09-02T23:20:32.4278105Z Container is terminated. Total time elapsed: 6744 ms. 2025-09-02T23:20:32.4279288Z Site container: xxxxxxx_xxxxxxx terminated during site startup. 2025-09-02T23:20:32.4280440Z Site: xxxxxxx stopped. -
Emmanuel GUENOU • 0 Points de réputation
2025-09-03T00:08:21.72+00:00 L'App Service migré en Sidecar semble défectueux. En recréant un autre en partant de 0 tout re-fonctionne comme avant.
-
Himanshu Shekhar • 1,350 Points de réputation • Personnel externe Microsoft • Modérateur
2025-09-03T11:17:11.31+00:00 Vielen Dank für die Bestätigung
-
Emmanuel GUENOU • 0 Points de réputation
2025-09-11T22:42:50.9066667+00:00 The error was linked to Application Insights.
When enabled, the app start listening then stops immediately.
The app only works when Application Insights is disabled.
Can anyone help debug this? -
Himanshu Shekhar • 1,350 Points de réputation • Personnel externe Microsoft • Modérateur
2025-09-12T14:37:29.7733333+00:00 Ack Emmanuel GUENOU
Veuillez confirmer que la variable d'environnement APPLICATIONINSIGHTS_CONNECTION_STRING est correctement définie avec une chaîne de connexion valide.
Si vous utilisez une identité gérée, assurez-vous que le rôle « Contributeur de composants Application Insights » lui est attribué sur la ressource Application Insights.
Désactivez temporairement ces fonctionnalités Application Insights lors de l'initialisation du SDK afin de réduire le temps de démarrage.
Assurez-vous que le conteneur dispose de suffisamment de CPU et de mémoire (minimum 256 Mo de RAM recommandé) pour permettre l'initialisation du SDK.
Définissez également la variable d'environnement APPLICATIONINSIGHTS_LOG_LEVEL=verbose pour obtenir des journaux de diagnostic détaillés du SDK.
-
Himanshu Shekhar • 1,350 Points de réputation • Personnel externe Microsoft • Modérateur
2025-09-16T10:06:20.78+00:00 Bonjour Emmanuel GUENOU ,
Pourriez-vous nous donner des nouvelles de ce message ?
N'hésitez pas à nous faire savoir si les étapes suggérées vous ont aidé ou si vous avez besoin d'aide.
-
Himanshu Shekhar • 1,350 Points de réputation • Personnel externe Microsoft • Modérateur
2025-09-17T08:34:17.3+00:00 Hello Emmanuel GUENOU,
Could you give us an update on this message?
Feel free to let us know if the suggested steps helped you or if you need help.
-
Emmanuel GUENOU • 0 Points de réputation
2025-09-17T13:56:07.2533333+00:00 I have an existing Application Insights.
I just link / unlink that one to my App Services. Why do I need to check the APPLICATIONINSIGHTS_CONNECTION_STRING now as it is filled automatically?
Should I recreate it (the Application Insights) from scratch? -
Rashmika Inagadapa • 1,095 Points de réputation • Personnel externe Microsoft • Modérateur
2025-10-06T11:12:02.18+00:00 No, you do not need to recreate your existing Application Insights resource. The APPLICATIONINSIGHTS_CONNECTION_STRING setting is automatically injected by Azure when you link your App Service to an existing Application Insights instance. However, verifying it, is recommended to ensure the environment variable is populated and valid in your App Service configuration.
When you link an App Service to an Application Insights resource, Azure automatically adds this app setting:
APPLICATIONINSIGHTS_CONNECTION_STRING=InstrumentationKey=...;IngestionEndpoint=...
This allows the SDK or the App Service auto-instrumentation agent to send telemetry to the correct Insights instance. However, there are a few cases where verification helps:
1.Configuration Drift or Link Sync Issue: Sometimes, especially after App Service migration, sidecar rollout, or resource recreation, the link between the App Service and Application Insights may not refresh properly.
In such cases, the connection string might be missing, empty, or pointing to an old region/endpoint.
2.Manual or Infrastructure Changes: If you use IaC (e.g., ARM, Bicep, Terraform) or scripts, the setting may have been overwritten.Confirming the connection string ensures the SDK has a valid telemetry endpoint.
3.Troubleshooting SDK Initialization Failures:If the Node.js Application Insights SDK crashes or fails to initialize, a malformed or undefined connection string is one of the first suspects.
Do not recreate the Application Insights resource. Simply go to your App Service → Configuration → Application Settings and confirm whether
· APPLICATIONINSIGHTS_CONNECTION_STRING exists,
· It’s not blank,
· It matches the connection string from your Application Insights resource’s Overview blade.
If it’s present and correct, no further action is required. The SDK will automatically pick it up during runtime.
For more information, refer here: Monitor Node.js Applications and Services with Application Insights (Classic API) - Azure Monitor | Microsoft Learn
Kindly check the above steps and references provided. Let me know if you require any additional assistance from my end. I am happy to help you with the queries.
Thanks,
Rashmika
-
Emmanuel GUENOU • 0 Points de réputation
2025-10-08T21:29:06.0033333+00:00 Hi Rashmika,
Thanks for the detailed response.
I've re-enabled App Insights as you suggested, and the backend has stopped failing repeatedly, in a systematic way, like it was over the past few weeks. I'll keep an eye on it to see if the issue returns and will definitely monitor the
APPLICATIONINSIGHTS_CONNECTION_STRINGover the next few days.Thanks again,
Emmanuel
Se connecter pour commenter