Mis show azure container app logs
Hi All,
I have 4 Azure Container App and setup the same configuration then store one Azure Log Analytics workspace and one Azure Storage account as below:
- Enable Diagnostics Settings for Each Container App
- Use command : az containerapp logs show --name name --resource-group name --follow => I have seen logs for 4 Azure Container App
But i dont when i use KQL Command on azure portal then run command into azure monitor log query then show only one only log of one Azure Container App?
What I mean is that I have 4 azure container app with the same configuration and using azure cli check on the local server, there are logs of all 4 but when I go to the portal and use KQL Command, it only shows only one azure container app log?
Azure Container Apps
-
Nho Luong • 25 Reputation points
2025-03-16T11:47:51.45+00:00 -
Pravallika Kothaveeranna Gari • 330 Reputation points • Microsoft External Staff
2025-03-17T04:08:43.8+00:00 Hi Nho Luong,
- Check if there is any delay in the logs being pushed to Azure Monitor. Logs typically appear in Log Analytics with a small delay, sometimes up to a few minutes. If you've just configured logging, give it some time and check again.
- Check all apps are actually generating logs. It could be due to one of the container apps isn't producing any logs due to a configuration issue or because it isn't receiving traffic.
-
Pravallika Kothaveeranna Gari • 330 Reputation points • Microsoft External Staff
2025-03-17T06:56:21.72+00:00 Hi Nho Luong,
Follow below steps to configure logging in Azure Container Apps:
- Navigate to Container Apps Environment of the Container App, go to
Monitoring=>Logging Options
, Select Azure Monitor.
- It updates the environment and Diagnostic settings will appear under Logging options menu.
- Configure Diagnostic settings to send the logs to Log Analytics Workspace.
It applies to all the container apps available under that particular environment.
Run the all the container apps.
It captures the logs of all the Container Apps available under the container apps environment.
If you are still unable to see the logs, you can create a new container app under the same environment and update the Diagnostic settings.
Refresh the environment and check the logs again. I have tested the same and it worked.
It is possible that the applications are not capturing the console logs, try running
ContainerAppSystemLogs
and check if you can see system logs.Hope this helps.
If the answer is helpful, please click Accept Answer and kindly upvote it. If you have any further questions about this answer, please click Comment.
- Navigate to Container Apps Environment of the Container App, go to
-
Nho Luong • 25 Reputation points
2025-03-17T10:48:29.31+00:00 Hello @Pravallika Kothaveeranna Gari
Thank you for your help
I'm sure step by step before i created this ticket as your show as above but still the same error EvenEven i have delete my azure container app and credeploy and create new Diagnostic
-
Pravallika Kothaveeranna Gari • 330 Reputation points • Microsoft External Staff
2025-03-17T10:52:51.4333333+00:00 Are all the container apps under the same environment? Can you create one more container app under the same environment and test again?
-
Nho Luong • 25 Reputation points
2025-03-17T12:30:24.97+00:00 Yes, one container connect with one environment i have more deleted and redeploy and try more time but the same error.
Hey
-
Nho Luong • 25 Reputation points
2025-03-17T12:33:25.6866667+00:00 Why? Azure very stupid
-
Pravallika Kothaveeranna Gari • 330 Reputation points • Microsoft External Staff
2025-03-17T12:38:15.11+00:00 I have created all the container apps under same(one) container apps environment and configured logging. It worked.
-
Pravallika Kothaveeranna Gari • 330 Reputation points • Microsoft External Staff
2025-03-18T15:20:57.3766667+00:00 Nho Luong, Just checking in to see if the above provided information helped to resolve the issue. If you have further queries, please let us know.
-
Pravallika Kothaveeranna Gari • 330 Reputation points • Microsoft External Staff
2025-03-19T03:42:54.97+00:00 Nho Luong, We still have not heard back from you. Could you please let us know if the above information was helpful? If it resolves your query, kindly click Accept Answer and Yes, as it could assist other community members reading this thread. Additionally, if you have any further questions, please let us know.
-
Nho Luong • 25 Reputation points
2025-03-26T03:35:53.2666667+00:00 Hey Still no work and also i have drop.
Thank you.
-
Deleted
This comment has been deleted due to a violation of our Code of Conduct. The comment was manually reported or identified through automated detection before action was taken. Please refer to our Code of Conduct for more information.
-
SadiqhAhmed-MSFT • 48,471 Reputation points • Microsoft Employee
2025-04-21T14:41:57.2933333+00:00 @Nho Luong Sorry for the delayed response. Since you observed that only one out of four Azure Container Apps is emitting logs to the Log Analytics workspace, despite all being within the same Container Apps Environment and having diagnostic settings enabled, several factors could be contributing to this issue.
Verify Diagnostic Settings Configuration
Diagnostic settings are configured at the Container Apps Environment level, not per individual app
Log Categories: Confirm that both
ContainerAppConsoleLogs
andContainerAppSystemLogs
are selected.Destination: Ensure that the logs are being sent to the correct Log Analytics workspace.
You can verify this using the Azure CLI:
az monitor diagnostic-settings list \ --resource "/subscriptions/<subscription-id>/resourceGroups/<resource-group>/providers/Microsoft.App/managedEnvironments/<environment-name>"
This command lists all diagnostic settings for the specified Container Apps Environment. Ensure that the settings include all necessary log categories and are correctly configured to send logs to the intended destination
**Confirm Log Generation by Each Container App:
**
It's possible that some container apps are not generating logs due to various reasons:No Traffic: If a container app isn't receiving any requests, it might not produce logs.
Logging Configuration: Ensure that the application within the container app is configured to write logs to
stdout
orstderr
, as these are captured by Azure Container Apps.Application Errors: If the application fails to start or crashes immediately, it might not produce logs.
To check if logs are being generated, you can use the Azure CLI:
az containerapp logs show \ --name <container-app-name> \ --resource-group <resource-group>
This command streams logs from the specified container app, allowing you to verify if it's producing logs as expected.
Query Logs in Log Analytics
Use Kusto Query Language (KQL) to query logs in the Log Analytics workspace and verify which container apps are producing logs:
ContainerAppConsoleLogs_CL | summarize LogCount = count() by ContainerAppName_s
This query provides a count of log entries per container app, helping identify which apps are emitting logs.
Check for Log Ingestion Delays
There might be a delay between log generation and their appearance in Log Analytics. Typically, logs appear within a few minutes, but delays can occur. If you've recently configured diagnostic settings, wait for a short period and then re-query the logs.
Review Container App Deployment and Configuration
Ensure that all container apps are correctly deployed and running:
- Deployment Status: Check if the container apps are in a running state.
- Environment Association: Verify that all container apps are associated with the correct Container Apps Environment.
- Revisions: If using revisions, ensure that the active revision is the one intended for logging.
You can list container apps and their statuses using the Azure CLI:
az containerapp list \ --resource-group <resource-group> \ --query "[].{Name:name, Status:provisioningState, Environment:managedEnvironmentId}"
Recreate Diagnostic Settings (If Necessary) -This is many time a quick solver
If after verifying all the above, the issue persists, consider deleting and recreating the diagnostic settings:
- Delete Existing Diagnostic Settings: Remove the current diagnostic settings from the Container Apps Environment.
- Recreate Diagnostic Settings: Set up new diagnostic settings, ensuring all necessary log categories are selected and the correct Log Analytics workspace is specified.
This process can resolve issues stemming from misconfigurations or corrupted settings.
Hope this helps!
Sign in to comment