Azure Container Apps need a way to send runtime data to centralized services so that you can analyze activity and spot problems. Diagnostic settings control which logs and metrics leave the container environment and where they go. You enable a diagnostic setting on a Container App resource and choose one or more destinations:
Collecting both logs (error messages, request details, configuration changes) and metrics (CPU, memory, request count) gives you a complete picture. Logs help you investigate what happened during an incident, while metrics help you detect resource exhaustion or scaling anomalies. The diagnostic setting defines a pipeline: data flows from the Container App to the chosen sink, where it becomes available for monitoring and alerting.
Azure Defender for Containers adds a security layer that scans container images and monitors running containers. The service performs two types of vulnerability assessment:
When integrated with Azure Defender, you get continuous visibility into the security posture of every container. A scan report shows each vulnerability, its severity, and remediation guidance. You can prioritize fixes based on risk and block vulnerable images from being deployed. At runtime, Defender generates security alerts when it detects behavior that deviates from a baseline, such as a container spawning a shell or connecting to a known malicious IP. These alerts feed into the same monitoring pipeline you set up with diagnostic settings.
Once logs and metrics arrive in Log Analytics or Event Hubs, you need rules that turn raw data into actionable signals. Azure Monitor and Azure Sentinel allow you to define custom alert rules that trigger when certain conditions are met. Common rule sources include:
Each alert rule can invoke an automated response, such as sending a notification, running a Logic App that scales down compromised containers, or executing a runbook that isolates the affected app. The combination of diagnostic settings and alert rules ensures that timely alerts are generated for both performance and security incidents.
By combining diagnostic settings, Azure Defender for Containers, and custom alert rules, you build a layered monitoring system that covers the full lifecycle of a containerized application. Data flows from the container to centralized storage, vulnerability scans run continuously, and behavioral rules detect anomalies in real time. Automated responses then contain threats before they escalate. This approach keeps container workloads compliant, secure, and resilient against both known vulnerabilities and emerging attack patterns.
Are you a guardian of your domain? Lean how to leverage your aptitude in security to protect Microsoft Azure technologies, with a goal of earning the Microsoft Certified: Azure Security Engineer Associate certification!
Prepare and test your skills

Prepare and test your skills

You can send diagnostic data from Azure Container Apps to Log Analytics workspaces for querying and analysis, to Event Hubs for streaming to external tools, or to Storage Accounts for long-term archival.
Azure Defender for Containers provides continuous security visibility by scanning container images for vulnerabilities like outdated libraries and known CVEs, and by monitoring running containers for suspicious process activity or network connections.
Custom alert rules can be created from Log Analytics query results to detect error patterns or unauthorized access, from metric thresholds for CPU or memory spikes, and from Azure Sentinel analytics rules that combine multiple data sources.