Skip to main content

container_groups

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

Overview

Namecontainer_groups
TypeResource
Idazure.container_instance.container_groups

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
idstringFully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}.
namestringThe name of the resource.
confidentialComputePropertiesobjectThe properties for confidential container group.
containerGroupProfileobjectThe reference container group profile properties.
containersarrayThe containers within the container group. Required.
diagnosticsobjectThe diagnostic information for a container group.
dnsConfigobjectThe DNS config information for a container group.
encryptionPropertiesobjectThe encryption properties for a container group.
extensionsarrayextensions used by virtual kubelet.
identityobjectThe identity of the container group, if configured.
identityAclsobjectThe access control levels of the identities.
imageRegistryCredentialsarrayThe image registry credentials by which the container group is created from.
initContainersarrayThe init containers for a container group.
instanceViewobjectThe instance view of the container group. Only valid in response.
ipAddressobjectThe IP address type of the container group.
isCreatedFromStandbyPoolbooleanThe flag to determine whether the container group is created from standby pool.
locationstringThe resource location of the container group.
osTypestringThe operating system type required by the containers in the container group. Known values are: "Windows" and "Linux". (Windows, Linux)
prioritystringThe priority of the container group. Known values are: "Regular" and "Spot". (Regular, Spot)
provisioningStatestringThe provisioning state of the container group. This only appears in the response.
restartPolicystringRestart policy for all containers within the container group. * Always Always restart * OnFailure Restart on failure * Never Never restart. Known values are: "Always", "OnFailure", and "Never". (Always, OnFailure, Never)
secretReferencesarrayThe secret references that will be referenced within the container group.
skustringThe SKU for a container group. Known values are: "NotSpecified", "Standard", "Dedicated", and "Confidential". (NotSpecified, Standard, Dedicated, Confidential)
standbyPoolProfileobjectThe reference standby pool profile properties.
subnetIdsarrayThe subnet resource IDs for a container group.
systemDataobjectAzure Resource Manager metadata containing createdBy and modifiedBy information.
tagsobjectThe resource tags.
typestringThe type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts".
volumesarrayThe list of volumes that can be mounted by containers in this container group.
zonesarrayThe availability zones.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectresource_group_name, container_group_name, subscription_idGet the properties of the specified container group. 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.
list_by_resource_groupselectresource_group_name, subscription_idGet a list of container groups in the specified subscription and resource group. Get 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.
listselectsubscription_idGet a list of container groups in the specified subscription. Get 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_updateinsertresource_group_name, container_group_name, subscription_id, propertiesCreate or update container groups. Create or update container groups with specified configurations.
updateupdateresource_group_name, container_group_name, subscription_idUpdate container groups. Updates container group tags with specified values.
create_or_updatereplaceresource_group_name, container_group_name, subscription_id, propertiesCreate or update container groups. Create or update container groups with specified configurations.
deletedeleteresource_group_name, container_group_name, subscription_idDelete the specified container group. 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.
get_outbound_network_dependencies_endpointsexecresource_group_name, container_group_name, subscription_idGet all network dependencies for container group. Gets all the network dependencies for this container group to allow complete control of network setting and configuration. For container groups, this will always be an empty list.
restartexecresource_group_name, container_group_name, subscription_idRestarts all containers in a container group. Restarts all containers in a container group in place. If container image has updates, new image will be downloaded.
stopexecresource_group_name, container_group_name, subscription_idStops all containers in a container group. Stops all containers in a container group. Compute resources will be deallocated and billing will stop.
startexecresource_group_name, container_group_name, subscription_idStarts all containers in a container group. Starts 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
container_group_namestringThe name of the container group. Required.
resource_group_namestringThe name of the resource group. The name is case insensitive. Required.
subscription_idstring

SELECT examples

Get the properties of the specified container group. 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,
confidentialComputeProperties,
containerGroupProfile,
containers,
diagnostics,
dnsConfig,
encryptionProperties,
extensions,
identity,
identityAcls,
imageRegistryCredentials,
initContainers,
instanceView,
ipAddress,
isCreatedFromStandbyPool,
location,
osType,
priority,
provisioningState,
restartPolicy,
secretReferences,
sku,
standbyPoolProfile,
subnetIds,
systemData,
tags,
type,
volumes,
zones
FROM azure.container_instance.container_groups
WHERE resource_group_name = '{{ resource_group_name }}' -- required
AND container_group_name = '{{ container_group_name }}' -- required
AND subscription_id = '{{ subscription_id }}' -- required
;

INSERT examples

Create or update container groups. Create or update container groups with specified configurations.

INSERT INTO azure.container_instance.container_groups (
location,
tags,
zones,
identity,
properties,
resource_group_name,
container_group_name,
subscription_id
)
SELECT
'{{ location }}',
'{{ tags }}',
'{{ zones }}',
'{{ identity }}',
'{{ properties }}' /* required */,
'{{ resource_group_name }}',
'{{ container_group_name }}',
'{{ subscription_id }}'
RETURNING
id,
name,
identity,
location,
properties,
systemData,
tags,
type,
zones
;

UPDATE examples

Update container groups. Updates container group tags with specified values.

UPDATE azure.container_instance.container_groups
SET
location = '{{ location }}',
tags = '{{ tags }}',
zones = '{{ zones }}'
WHERE
resource_group_name = '{{ resource_group_name }}' --required
AND container_group_name = '{{ container_group_name }}' --required
AND subscription_id = '{{ subscription_id }}' --required
RETURNING
id,
name,
identity,
location,
properties,
systemData,
tags,
type,
zones;

REPLACE examples

Create or update container groups. Create or update container groups with specified configurations.

REPLACE azure.container_instance.container_groups
SET
location = '{{ location }}',
tags = '{{ tags }}',
zones = '{{ zones }}',
identity = '{{ identity }}',
properties = '{{ properties }}'
WHERE
resource_group_name = '{{ resource_group_name }}' --required
AND container_group_name = '{{ container_group_name }}' --required
AND subscription_id = '{{ subscription_id }}' --required
AND properties = '{{ properties }}' --required
RETURNING
id,
name,
identity,
location,
properties,
systemData,
tags,
type,
zones;

DELETE examples

Delete the specified container group. 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_instance.container_groups
WHERE resource_group_name = '{{ resource_group_name }}' --required
AND container_group_name = '{{ container_group_name }}' --required
AND subscription_id = '{{ subscription_id }}' --required
;

Lifecycle Methods

Get all network dependencies for container group. Gets all the network dependencies for this container group to allow complete control of network setting and configuration. For container groups, this will always be an empty list.

EXEC azure.container_instance.container_groups.get_outbound_network_dependencies_endpoints 
@resource_group_name='{{ resource_group_name }}' --required,
@container_group_name='{{ container_group_name }}' --required,
@subscription_id='{{ subscription_id }}' --required
;