Azure Cloud Log Streaming

Monitor your deployed Azure services with log streaming from Azure Log Analytics, integrated directly into the azd app dashboard.

Overview

azd app supports streaming logs from your deployed Azure services alongside local logs in a unified dashboard experience. View logs from Azure Container Apps, App Service, and Functions without switching tools or contexts.

Unified view of Azure cloud logs in the azd app dashboard
â„šī¸ Log Ingestion Latency

Azure Log Analytics has a typical ingestion delay of 1-5 minutes. Logs are not real-time but refresh automatically based on your configured polling interval (default: 30 seconds).

Supported Azure Services

đŸ“Ļ
Container Apps
ContainerAppConsoleLogs_CL
🌐
App Service
AppServiceConsoleLogs
⚡
Functions
FunctionAppLogs

Configuration

Project-Level Settings

Configure global Log Analytics settings that apply to all services in your azure.yaml file:

azure.yaml
logs:
analytics:
pollingInterval: 30s
defaultTimespan: PT15M
pollingInterval - How often to query Log Analytics (default: 30s)
defaultTimespan - Time range for log queries in ISO 8601 duration format (default: PT15M for 15 minutes)

Service-Level Table Selection

Specify which Log Analytics table to query for each service. This overrides automatic table detection:

azure.yaml
services:
web:
host: appservice
path: ./src/web
logs:
analytics:
table: AppServiceConsoleLogs
api:
host: containerapp
path: ./src/api
logs:
analytics:
table: ContainerAppConsoleLogs_CL
💡 Table Names

Container Apps use custom log tables with _CL suffix. App Service and Functions use standard tables without suffix.

Complete Example

azure.yaml
services:
web:
host: appservice
path: ./src/web
logs:
analytics:
table: AppServiceConsoleLogs
api:
host: containerapp
path: ./src/api
logs:
analytics:
table: ContainerAppConsoleLogs_CL
functions:
host: functions
path: ./src/functions
logs:
analytics:
table: FunctionAppLogs
logs:
analytics:
pollingInterval: 30s
defaultTimespan: PT15M

Dashboard Features

Time Range Selection

Choose from preset time ranges to view logs from different time windows:

  • 15 minutes - Most recent logs (PT15M)
  • 30 minutes - Last half hour (PT30M)
  • 6 hours - Extended recent history (PT6H)
  • 24 hours - Full day view (PT24H)
Select time ranges to view logs from different time windows

Service Filtering

Filter logs to show only specific services, making it easier to focus on one part of your application:

Filter logs by service to focus on specific components

Mode Toggle

Switch between local and Azure logs with a single click. The dashboard remembers your preference and automatically refreshes logs based on the selected mode.

Authentication Requirements

Azure Log Analytics integration requires Azure CLI authentication. Ensure you're logged in before running azd app run:

Terminal window
az login

The azd app will use your Azure CLI credentials to query Log Analytics workspaces associated with your deployed resources.

Troubleshooting

No Logs Appearing

  • Wait for ingestion: Azure Log Analytics has a 1-5 minute delay. New logs take time to appear.
  • Check authentication: Run az account show to verify you're logged in.
  • Verify deployment: Ensure services are actually deployed to Azure with azd provision or azd up.
  • Check table names: Ensure the correct Log Analytics table is configured for each service type.

Performance Considerations

  • Polling interval: Increase pollingInterval if queries are slow or rate-limited.
  • Time range: Shorter time ranges (PT15M) query less data and return faster.
  • Service filtering: Use service filters to reduce the amount of log data processed.

Common Errors

Error: Failed to query Log Analytics workspace

Check Azure CLI authentication and ensure your account has Log Analytics Reader permissions on the workspace.

Error: Table not found

Verify the table name in your azure.yaml matches the actual table in Log Analytics. Container Apps typically use _CL suffix.

Advanced: Custom KQL Queries

For advanced scenarios, you can provide custom KQL (Kusto Query Language) queries in your azure.yaml. This is a yaml-only feature not exposed in the dashboard UI:

azure.yaml
services:
web:
host: appservice
path: ./src/web
logs:
analytics:
query: |
AppServiceConsoleLogs
| where TimeGenerated > ago(15m)
| where ResultDescription contains "error"
| order by TimeGenerated desc
| limit 100
âš ī¸ Advanced Feature

Custom KQL queries are for advanced users familiar with Azure Log Analytics. The dashboard time range and service filters will not affect custom queries.

Learn More