Skip to content

feat: add azd monitor --tail for in-terminal log streaming#7331

Draft
Copilot wants to merge 3 commits intomainfrom
copilot/add-azure-application-logs-support
Draft

feat: add azd monitor --tail for in-terminal log streaming#7331
Copilot wants to merge 3 commits intomainfrom
copilot/add-azure-application-logs-support

Conversation

Copy link
Contributor

Copilot AI commented Mar 25, 2026

azd monitor currently only opens Azure Portal URLs in a browser. This adds --tail for direct CLI log streaming from deployed App Service, Azure Functions, and Container Apps resources.

# Stream logs from a deployed service (auto-discovers resources, prompts if multiple)
azd monitor --tail

Changes

  • cmd/monitor.go — New --tail flag. When set, discovers deployed resources via existing resource group enumeration, filters to streamable types (Microsoft.Web/sites, Microsoft.App/containerApps), prompts for selection if multiple found, and streams logs to console.GetWriter() with Ctrl+C handling.

  • pkg/azapi/appservice_logstream.goAzureClient.GetAppServiceLogStream(): connects to Kudu SCM /api/logstream with bearer token auth. Covers both App Service and Functions targets (both are Microsoft.Web/sites).

  • pkg/containerapps/logstream.gocontainerAppService.GetLogStream(): resolves latest revision → lists replicas → reads ReplicaContainer.LogStreamEndpoint from the SDK → authenticates via GetAuthToken → streams response body.

  • pkg/containerapps/container_app.go — Added GetLogStream to the ContainerAppService interface.

Design notes

  • No azure.yaml / project config required — works purely from the provisioned environment, consistent with existing --live/--logs/--overview flags.
  • Container Apps streaming uses the SDK-provided LogStreamEndpoint on ReplicaContainer + the stable GetAuthToken API, avoiding preview API versions.
  • When --tail is not specified, existing behavior (default to --overview) is preserved.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • aka.ms
    • Triggering command: /home/REDACTED/work/azure-dev/azure-dev/cli/azd/azd /home/REDACTED/work/azure-dev/azure-dev/cli/azd/azd extension source add -n local -t file -l /home/REDACTED/work/azure-dev/azure-dev/cli/azd/extensions/registry.json -lang=go1.26 x_amd64/vet -I -DTNxMp6M -I x_amd64/vet --gdwarf-5 g/protobuf/types-atomic -o x_amd64/vet (dns block)
    • Triggering command: /home/REDACTED/work/azure-dev/azure-dev/cli/azd/azd /home/REDACTED/work/azure-dev/azure-dev/cli/azd/azd extension list --source local --output json x_amd64/vet -p g/grpc/grpclog -lang=go1.26 x_amd64/vet -I Wxv7f21s0 om/cenkalti/back-ifaceassert x_amd64/vet --gdwarf-5 go -o x_amd64/vet (dns block)
    • Triggering command: /home/REDACTED/work/azure-dev/azure-dev/cli/azd/azd /home/REDACTED/work/azure-dev/azure-dev/cli/azd/azd extension install azure.ai.agents --source local --version 0.1.18-preview -p t/message -lang=go1.16 x_amd64/vet -I q48QNS-ah pkg/mod/github.c-ifaceassert x_amd64/vet --gdwarf-5 g/protobuf/proto-atomic -o x_amd64/vet (dns block)

If you need me to access, download, or install something from one of these locations, you can either:


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI and others added 2 commits March 26, 2026 00:12
Add support for streaming application logs directly to the terminal for
App Service, Azure Functions, and Container Apps via `azd monitor --tail`.

- App Service/Functions: stream via Kudu SCM /api/logstream endpoint
- Container Apps: stream via replica container LogStreamEndpoint with auth token
- Auto-discovers deployed resources and prompts for selection when multiple found

Agent-Logs-Url: https://github.com/Azure/azure-dev/sessions/293fdb62-c4b1-470c-946f-0cd5395d6bfe

Co-authored-by: spboyer <7681382+spboyer@users.noreply.github.com>
Copilot AI changed the title [WIP] Add support to retrieve application logs from Azure app feat: add azd monitor --tail for in-terminal log streaming Mar 26, 2026
Copilot AI requested a review from spboyer March 26, 2026 00:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add support to easily retrieve application logs from a running Azure application

2 participants