Note

Access to this page requires authorization. You can try signing in or .

Access to this page requires authorization. You can try .

az containerapp logs

Show container app logs.

Commands

Name Description Type Status
az containerapp logs show

Show past logs and/or print logs in real time (with the --follow parameter). Note that the logs are only taken from one revision, replica, and container (for non-system logs).

Core GA

az containerapp logs show

Show past logs and/or print logs in real time (with the --follow parameter). Note that the logs are only taken from one revision, replica, and container (for non-system logs).

az containerapp logs show --name
 --resource-group
 [--container]
 [--follow {false, true}]
 [--format {json, text}]
 [--replica]
 [--revision]
 [--tail]
 [--type {console, system}]

Examples

Fetch the past 20 lines of logs from an app and return

az containerapp logs show -n my-containerapp -g MyResourceGroup

Fetch the past 20 lines of system logs from an app and return

az containerapp logs show -n my-containerapp -g MyResourceGroup --type system

Fetch 30 lines of past logs logs from an app and print logs as they come in

az containerapp logs show -n my-containerapp -g MyResourceGroup --follow --tail 30

Fetch logs for a particular revision, replica, and container

az containerapp logs show -n my-containerapp -g MyResourceGroup --replica MyReplica --revision MyRevision --container MyContainer

Required Parameters

--name -n

The name of the Containerapp.

--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

Optional Parameters

The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.

--container

The name of the container.

--follow

Print logs in real time if present.

Property Value
Default value: False
Accepted values: false, true
--format

Log output format.

Property Value
Default value: json
Accepted values: json, text
--replica

The name of the replica. List replicas with 'az containerapp replica list'. A replica may not exist if there is not traffic to your app.

--revision

The name of the container app revision. Defaults to the latest revision.

--tail

The number of past logs to print (0-300).

Property Value
Default value: 20
--type -t

Type of logs to stream.

Property Value
Default value: console
Accepted values: console, system

Feedback

Was this page helpful?