Skip to main content

containers

Creates, updates, deletes, gets or lists a containers resource.

Overview

Namecontainers
TypeResource
Idazure.container_instance.containers

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
contentstringThe content of the log.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
list_logsselectresource_group_name, container_group_name, container_name, subscription_idtail, timestampsGet the logs for a specified container instance. Get the logs for a specified container instance in a specified resource group and container group.
execute_commandexecresource_group_name, container_group_name, container_name, subscription_idExecutes a command in a specific container instance. Executes a command for a specific container instance in a specified resource group and container group.
attachexecresource_group_name, container_group_name, container_name, subscription_idAttach to the output of a specific container instance. Attach to the output stream of a specific container instance in a specified resource group and container group.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
container_group_namestringThe name of the container group. Required.
container_namestringThe name of the container instance. Required.
resource_group_namestringThe name of the resource group. The name is case insensitive. Required.
subscription_idstring
tailintegerThe number of lines to show from the tail of the container instance log. If not provided, all available logs are shown up to 4mb. Default value is None.
timestampsbooleanIf true, adds a timestamp at the beginning of every line of log output. If not provided, defaults to false. Default value is None.

SELECT examples

Get the logs for a specified container instance. Get the logs for a specified container instance in a specified resource group and container group.

SELECT
content
FROM azure.container_instance.containers
WHERE resource_group_name = '{{ resource_group_name }}' -- required
AND container_group_name = '{{ container_group_name }}' -- required
AND container_name = '{{ container_name }}' -- required
AND subscription_id = '{{ subscription_id }}' -- required
AND tail = '{{ tail }}'
AND timestamps = '{{ timestamps }}'
;

Lifecycle Methods

Executes a command in a specific container instance. Executes a command for a specific container instance in a specified resource group and container group.

EXEC azure.container_instance.containers.execute_command 
@resource_group_name='{{ resource_group_name }}' --required,
@container_group_name='{{ container_group_name }}' --required,
@container_name='{{ container_name }}' --required,
@subscription_id='{{ subscription_id }}' --required
@@json=
'{
"command": "{{ command }}",
"terminalSize": "{{ terminalSize }}"
}'
;