Ask Learn
Preview
Ask Learn is an AI assistant that can answer questions, clarify concepts, and define terms using trusted Microsoft documentation.
Please sign in to use Ask Learn.
Sign inThis browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Get the logs for a specified container instance in a specified resource group and container group.
Get-AzContainerInstanceLog
-ContainerGroupName <String>
-ContainerName <String>
-ResourceGroupName <String>
[-SubscriptionId <String[]>]
[-Tail <Int32>]
[-Timestamp]
[-DefaultProfile <PSObject>]
[<CommonParameters>]
Get the logs for a specified container instance in a specified resource group and container group.
Get-AzContainerInstanceLog -ContainerGroupName test-cg -ContainerName test-container -ResourceGroupName test-rg
/docker-entrypoint.sh: /docker-entrypoint.d/ is not empty, will attempt to perform configuration
/docker-entrypoint.sh: Looking for shell scripts in /docker-entrypoint.d/
/docker-entrypoint.sh: Launching /docker-entrypoint.d/10-listen-on-ipv6-by-default.sh
10-listen-on-ipv6-by-default.sh: info: Getting the checksum of /etc/nginx/conf.d/default.conf
10-listen-on-ipv6-by-default.sh: info: Enabled listen on IPv6 in /etc/nginx/conf.d/default.conf
/docker-entrypoint.sh: Launching /docker-entrypoint.d/20-envsubst-on-templates.sh
/docker-entrypoint.sh: Launching /docker-entrypoint.d/30-tune-worker-processes.sh
/docker-entrypoint.sh: Configuration complete; ready for start up
Get the log from test-container in container group test-cg. By default, it will return up to 4MB log content.
Get-AzContainerInstanceLog -ContainerGroupName test-cg -ContainerName test-container -ResourceGroupName test-rg -Tail 2
/docker-entrypoint.sh: Launching /docker-entrypoint.d/30-tune-worker-processes.sh
/docker-entrypoint.sh: Configuration complete; ready for start up
Get the tail 2 lines of log from test-container in container group test-cg.
The name of the container group.
Type: | String |
Default value: | None |
Supports wildcards: | False |
DontShow: | False |
Position: | Named |
Mandatory: | True |
Value from pipeline: | False |
Value from pipeline by property name: | False |
Value from remaining arguments: | False |
The name of the container instance.
Type: | String |
Default value: | None |
Supports wildcards: | False |
DontShow: | False |
Position: | Named |
Mandatory: | True |
Value from pipeline: | False |
Value from pipeline by property name: | False |
Value from remaining arguments: | False |
The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.
Type: | PSObject |
Default value: | None |
Supports wildcards: | False |
DontShow: | False |
Aliases: | AzureRMContext, AzureCredential |
Position: | Named |
Mandatory: | False |
Value from pipeline: | False |
Value from pipeline by property name: | False |
Value from remaining arguments: | False |
The name of the resource group. The name is case insensitive.
Type: | String |
Default value: | None |
Supports wildcards: | False |
DontShow: | False |
Position: | Named |
Mandatory: | True |
Value from pipeline: | False |
Value from pipeline by property name: | False |
Value from remaining arguments: | False |
The ID of the target subscription. The value must be an UUID.
Type: | String[] |
Default value: | (Get-AzContext).Subscription.Id |
Supports wildcards: | False |
DontShow: | False |
Position: | Named |
Mandatory: | False |
Value from pipeline: | False |
Value from pipeline by property name: | False |
Value from remaining arguments: | False |
The number of lines to show from the tail of the container instance log. If not provided, all available logs are shown up to 4mb.
Type: | Int32 |
Default value: | None |
Supports wildcards: | False |
DontShow: | False |
Position: | Named |
Mandatory: | False |
Value from pipeline: | False |
Value from pipeline by property name: | False |
Value from remaining arguments: | False |
If true, adds a timestamp at the beginning of every line of log output. If not provided, defaults to false.
Type: | SwitchParameter |
Default value: | None |
Supports wildcards: | False |
DontShow: | False |
Position: | Named |
Mandatory: | False |
Value from pipeline: | False |
Value from pipeline by property name: | False |
Value from remaining arguments: | False |
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.
Azure PowerShell feedback
Azure PowerShell is an open source project. Select a link to provide feedback:
Ask Learn is an AI assistant that can answer questions, clarify concepts, and define terms using trusted Microsoft documentation.
Please sign in to use Ask Learn.
Sign in