Skip to main content

container_groups

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

Overview

Namecontainer_groups
TypeResource
Idazure.container_instances.container_groups

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
idstringThe resource id.
namestringThe resource name.
identityobjectThe identity of the container group, if configured.
locationstringThe resource location.
propertiesobjectThe container group properties
tagsobjectThe resource tags.
typestringThe resource type.
zonesarrayThe zones for the container group.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectsubscriptionId, resourceGroupName, containerGroupNameGets the properties of the specified container group in the specified subscription and resource group. The operation returns the properties of each container group including containers, image registry credentials, restart policy, IP address type, OS type, state, and volumes.
list_by_resource_groupselectsubscriptionId, resourceGroupNameGet a list of container groups in a specified subscription and resource group. This operation returns properties of each container group including containers, image registry credentials, restart policy, IP address type, OS type, state, and volumes.
listselectsubscriptionIdGet a list of container groups in the specified subscription. This operation returns properties of each container group including containers, image registry credentials, restart policy, IP address type, OS type, state, and volumes.
create_or_updateinsertsubscriptionId, resourceGroupName, containerGroupNameCreate or update container groups with specified configurations.
updateupdatesubscriptionId, resourceGroupName, containerGroupNameUpdates container group tags with specified values.
deletedeletesubscriptionId, resourceGroupName, containerGroupNameDelete the specified container group in the specified subscription and resource group. The operation does not delete other resources provided by the user, such as volumes.
restartexecsubscriptionId, resourceGroupName, containerGroupNameRestarts all containers in a container group in place. If container image has updates, new image will be downloaded.
stopexecsubscriptionId, resourceGroupName, containerGroupNameStops all containers in a container group. Compute resources will be deallocated and billing will stop.
startexecsubscriptionId, resourceGroupName, containerGroupNameStarts all containers in a container group. Compute resources will be allocated and billing will start.

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
containerGroupNamestringThe name of the container group.
resourceGroupNamestringThe name of the resource group.
subscriptionIdstringSubscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.

SELECT examples

Gets the properties of the specified container group in the specified subscription and resource group. The operation returns the properties of each container group including containers, image registry credentials, restart policy, IP address type, OS type, state, and volumes.

SELECT
id,
name,
identity,
location,
properties,
tags,
type,
zones
FROM azure.container_instances.container_groups
WHERE subscriptionId = '{{ subscriptionId }}' -- required
AND resourceGroupName = '{{ resourceGroupName }}' -- required
AND containerGroupName = '{{ containerGroupName }}' -- required
;

INSERT examples

Create or update container groups with specified configurations.

INSERT INTO azure.container_instances.container_groups (
data__location,
data__tags,
data__zones,
data__identity,
data__properties,
subscriptionId,
resourceGroupName,
containerGroupName
)
SELECT
'{{ location }}',
'{{ tags }}',
'{{ zones }}',
'{{ identity }}',
'{{ properties }}',
'{{ subscriptionId }}',
'{{ resourceGroupName }}',
'{{ containerGroupName }}'
RETURNING
id,
name,
identity,
location,
properties,
tags,
type,
zones
;

UPDATE examples

Updates container group tags with specified values.

UPDATE azure.container_instances.container_groups
SET
data__location = '{{ location }}',
data__tags = '{{ tags }}',
data__zones = '{{ zones }}'
WHERE
subscriptionId = '{{ subscriptionId }}' --required
AND resourceGroupName = '{{ resourceGroupName }}' --required
AND containerGroupName = '{{ containerGroupName }}' --required
RETURNING
id,
name,
identity,
location,
properties,
tags,
type,
zones;

DELETE examples

Delete the specified container group in the specified subscription and resource group. The operation does not delete other resources provided by the user, such as volumes.

DELETE FROM azure.container_instances.container_groups
WHERE subscriptionId = '{{ subscriptionId }}' --required
AND resourceGroupName = '{{ resourceGroupName }}' --required
AND containerGroupName = '{{ containerGroupName }}' --required
;

Lifecycle Methods

Restarts all containers in a container group in place. If container image has updates, new image will be downloaded.

EXEC azure.container_instances.container_groups.restart 
@subscriptionId='{{ subscriptionId }}' --required,
@resourceGroupName='{{ resourceGroupName }}' --required,
@containerGroupName='{{ containerGroupName }}' --required
;