feat: add azd monitor --tail for in-terminal log streaming#7331
Draft
feat: add azd monitor --tail for in-terminal log streaming#7331
azd monitor --tail for in-terminal log streaming#7331Conversation
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>
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 Mar 26, 2026
azd monitor --tail for in-terminal log streaming
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
azd monitorcurrently only opens Azure Portal URLs in a browser. This adds--tailfor 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 --tailChanges
cmd/monitor.go— New--tailflag. 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 toconsole.GetWriter()with Ctrl+C handling.pkg/azapi/appservice_logstream.go—AzureClient.GetAppServiceLogStream(): connects to Kudu SCM/api/logstreamwith bearer token auth. Covers both App Service and Functions targets (both areMicrosoft.Web/sites).pkg/containerapps/logstream.go—containerAppService.GetLogStream(): resolves latest revision → lists replicas → readsReplicaContainer.LogStreamEndpointfrom the SDK → authenticates viaGetAuthToken→ streams response body.pkg/containerapps/container_app.go— AddedGetLogStreamto theContainerAppServiceinterface.Design notes
azure.yaml/ project config required — works purely from the provisioned environment, consistent with existing--live/--logs/--overviewflags.LogStreamEndpointonReplicaContainer+ the stableGetAuthTokenAPI, avoiding preview API versions.--tailis 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/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)/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)/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.