container_groups
Creates, updates, deletes, gets or lists a container_groups resource.
Overview
| Name | container_groups |
| Type | Resource |
| Id | azure.container_instance.container_groups |
Fields
The following fields are returned by SELECT queries:
- get
- list_by_resource_group
- list
| Name | Datatype | Description |
|---|---|---|
id | string | Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. |
name | string | The name of the resource. |
confidentialComputeProperties | object | The properties for confidential container group. |
containerGroupProfile | object | The reference container group profile properties. |
containers | array | The containers within the container group. Required. |
diagnostics | object | The diagnostic information for a container group. |
dnsConfig | object | The DNS config information for a container group. |
encryptionProperties | object | The encryption properties for a container group. |
extensions | array | extensions used by virtual kubelet. |
identity | object | The identity of the container group, if configured. |
identityAcls | object | The access control levels of the identities. |
imageRegistryCredentials | array | The image registry credentials by which the container group is created from. |
initContainers | array | The init containers for a container group. |
instanceView | object | The instance view of the container group. Only valid in response. |
ipAddress | object | The IP address type of the container group. |
isCreatedFromStandbyPool | boolean | The flag to determine whether the container group is created from standby pool. |
location | string | The resource location of the container group. |
osType | string | The operating system type required by the containers in the container group. Known values are: "Windows" and "Linux". (Windows, Linux) |
priority | string | The priority of the container group. Known values are: "Regular" and "Spot". (Regular, Spot) |
provisioningState | string | The provisioning state of the container group. This only appears in the response. |
restartPolicy | string | Restart 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) |
secretReferences | array | The secret references that will be referenced within the container group. |
sku | string | The SKU for a container group. Known values are: "NotSpecified", "Standard", "Dedicated", and "Confidential". (NotSpecified, Standard, Dedicated, Confidential) |
standbyPoolProfile | object | The reference standby pool profile properties. |
subnetIds | array | The subnet resource IDs for a container group. |
systemData | object | Azure Resource Manager metadata containing createdBy and modifiedBy information. |
tags | object | The resource tags. |
type | string | The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts". |
volumes | array | The list of volumes that can be mounted by containers in this container group. |
zones | array | The availability zones. |
| Name | Datatype | Description |
|---|---|---|
id | string | Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. |
name | string | The name of the resource. |
confidentialComputeProperties | object | The properties for confidential container group. |
containerGroupProfile | object | The reference container group profile properties. |
containers | array | The containers within the container group. Required. |
diagnostics | object | The diagnostic information for a container group. |
dnsConfig | object | The DNS config information for a container group. |
encryptionProperties | object | The encryption properties for a container group. |
extensions | array | extensions used by virtual kubelet. |
identity | object | The identity of the container group, if configured. |
identityAcls | object | The access control levels of the identities. |
imageRegistryCredentials | array | The image registry credentials by which the container group is created from. |
initContainers | array | The init containers for a container group. |
instanceView | object | The instance view of the container group. Only valid in response. |
ipAddress | object | The IP address type of the container group. |
isCreatedFromStandbyPool | boolean | The flag to determine whether the container group is created from standby pool. |
location | string | The resource location of the container group. |
osType | string | The operating system type required by the containers in the container group. Known values are: "Windows" and "Linux". (Windows, Linux) |
priority | string | The priority of the container group. Known values are: "Regular" and "Spot". (Regular, Spot) |
provisioningState | string | The provisioning state of the container group. This only appears in the response. |
restartPolicy | string | Restart 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) |
secretReferences | array | The secret references that will be referenced within the container group. |
sku | string | The SKU for a container group. Known values are: "NotSpecified", "Standard", "Dedicated", and "Confidential". (NotSpecified, Standard, Dedicated, Confidential) |
standbyPoolProfile | object | The reference standby pool profile properties. |
subnetIds | array | The subnet resource IDs for a container group. |
systemData | object | Azure Resource Manager metadata containing createdBy and modifiedBy information. |
tags | object | The resource tags. |
type | string | The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts". |
volumes | array | The list of volumes that can be mounted by containers in this container group. |
zones | array | The availability zones. |
| Name | Datatype | Description |
|---|---|---|
id | string | Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. |
name | string | The name of the resource. |
confidentialComputeProperties | object | The properties for confidential container group. |
containerGroupProfile | object | The reference container group profile properties. |
containers | array | The containers within the container group. Required. |
diagnostics | object | The diagnostic information for a container group. |
dnsConfig | object | The DNS config information for a container group. |
encryptionProperties | object | The encryption properties for a container group. |
extensions | array | extensions used by virtual kubelet. |
identity | object | The identity of the container group, if configured. |
identityAcls | object | The access control levels of the identities. |
imageRegistryCredentials | array | The image registry credentials by which the container group is created from. |
initContainers | array | The init containers for a container group. |
instanceView | object | The instance view of the container group. Only valid in response. |
ipAddress | object | The IP address type of the container group. |
isCreatedFromStandbyPool | boolean | The flag to determine whether the container group is created from standby pool. |
location | string | The resource location of the container group. |
osType | string | The operating system type required by the containers in the container group. Known values are: "Windows" and "Linux". (Windows, Linux) |
priority | string | The priority of the container group. Known values are: "Regular" and "Spot". (Regular, Spot) |
provisioningState | string | The provisioning state of the container group. This only appears in the response. |
restartPolicy | string | Restart 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) |
secretReferences | array | The secret references that will be referenced within the container group. |
sku | string | The SKU for a container group. Known values are: "NotSpecified", "Standard", "Dedicated", and "Confidential". (NotSpecified, Standard, Dedicated, Confidential) |
standbyPoolProfile | object | The reference standby pool profile properties. |
subnetIds | array | The subnet resource IDs for a container group. |
systemData | object | Azure Resource Manager metadata containing createdBy and modifiedBy information. |
tags | object | The resource tags. |
type | string | The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts". |
volumes | array | The list of volumes that can be mounted by containers in this container group. |
zones | array | The availability zones. |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get | select | resource_group_name, container_group_name, subscription_id | 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. | |
list_by_resource_group | select | resource_group_name, subscription_id | Get 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. | |
list | select | subscription_id | Get 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_update | insert | resource_group_name, container_group_name, subscription_id, properties | Create or update container groups. Create or update container groups with specified configurations. | |
update | update | resource_group_name, container_group_name, subscription_id | Update container groups. Updates container group tags with specified values. | |
create_or_update | replace | resource_group_name, container_group_name, subscription_id, properties | Create or update container groups. Create or update container groups with specified configurations. | |
delete | delete | resource_group_name, container_group_name, subscription_id | 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. | |
get_outbound_network_dependencies_endpoints | exec | resource_group_name, container_group_name, subscription_id | 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. | |
restart | exec | resource_group_name, container_group_name, subscription_id | Restarts 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. | |
stop | exec | resource_group_name, container_group_name, subscription_id | Stops all containers in a container group. Stops all containers in a container group. Compute resources will be deallocated and billing will stop. | |
start | exec | resource_group_name, container_group_name, subscription_id | Starts 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.
| Name | Datatype | Description |
|---|---|---|
container_group_name | string | The name of the container group. Required. |
resource_group_name | string | The name of the resource group. The name is case insensitive. Required. |
subscription_id | string |
SELECT examples
- get
- list_by_resource_group
- list
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
;
Get 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.
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 subscription_id = '{{ subscription_id }}' -- required
;
Get 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.
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 subscription_id = '{{ subscription_id }}' -- required
;
INSERT examples
- create_or_update
- Manifest
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
;
# Description fields are for documentation purposes
- name: container_groups
props:
- name: resource_group_name
value: "{{ resource_group_name }}"
description: Required parameter for the container_groups resource.
- name: container_group_name
value: "{{ container_group_name }}"
description: Required parameter for the container_groups resource.
- name: subscription_id
value: "{{ subscription_id }}"
description: Required parameter for the container_groups resource.
- name: location
value: "{{ location }}"
description: |
The resource location of the container group.
- name: tags
value: "{{ tags }}"
description: |
The resource tags.
- name: zones
value:
- "{{ zones }}"
description: |
The availability zones.
- name: identity
description: |
The identity of the container group, if configured.
value:
principalId: "{{ principalId }}"
tenantId: "{{ tenantId }}"
type: "{{ type }}"
userAssignedIdentities: "{{ userAssignedIdentities }}"
- name: properties
description: |
The container group properties. Required.
value:
provisioningState: "{{ provisioningState }}"
secretReferences:
- name: "{{ name }}"
identity: "{{ identity }}"
secretReferenceUri: "{{ secretReferenceUri }}"
containers:
- name: "{{ name }}"
properties:
image: "{{ image }}"
command:
- "{{ command }}"
ports:
- protocol: "{{ protocol }}"
port: {{ port }}
environmentVariables:
- name: "{{ name }}"
value: "{{ value }}"
secureValue: "{{ secureValue }}"
secureValueReference: "{{ secureValueReference }}"
instanceView:
restartCount: {{ restartCount }}
currentState:
state: "{{ state }}"
startTime: "{{ startTime }}"
exitCode: {{ exitCode }}
finishTime: "{{ finishTime }}"
detailStatus: "{{ detailStatus }}"
previousState:
state: "{{ state }}"
startTime: "{{ startTime }}"
exitCode: {{ exitCode }}
finishTime: "{{ finishTime }}"
detailStatus: "{{ detailStatus }}"
events:
- count: {{ count }}
firstTimestamp: "{{ firstTimestamp }}"
lastTimestamp: "{{ lastTimestamp }}"
name: "{{ name }}"
message: "{{ message }}"
type: "{{ type }}"
resources:
requests:
memoryInGB: {{ memoryInGB }}
cpu: {{ cpu }}
gpu: "{{ gpu }}"
limits:
memoryInGB: {{ memoryInGB }}
cpu: {{ cpu }}
gpu: "{{ gpu }}"
volumeMounts:
- name: "{{ name }}"
mountPath: "{{ mountPath }}"
readOnly: {{ readOnly }}
livenessProbe:
exec:
command: "{{ command }}"
httpGet:
path: "{{ path }}"
port: {{ port }}
scheme: "{{ scheme }}"
httpHeaders: "{{ httpHeaders }}"
initialDelaySeconds: {{ initialDelaySeconds }}
periodSeconds: {{ periodSeconds }}
failureThreshold: {{ failureThreshold }}
successThreshold: {{ successThreshold }}
timeoutSeconds: {{ timeoutSeconds }}
readinessProbe:
exec:
command: "{{ command }}"
httpGet:
path: "{{ path }}"
port: {{ port }}
scheme: "{{ scheme }}"
httpHeaders: "{{ httpHeaders }}"
initialDelaySeconds: {{ initialDelaySeconds }}
periodSeconds: {{ periodSeconds }}
failureThreshold: {{ failureThreshold }}
successThreshold: {{ successThreshold }}
timeoutSeconds: {{ timeoutSeconds }}
securityContext:
privileged: {{ privileged }}
allowPrivilegeEscalation: {{ allowPrivilegeEscalation }}
capabilities:
add: "{{ add }}"
drop: "{{ drop }}"
runAsGroup: {{ runAsGroup }}
runAsUser: {{ runAsUser }}
seccompProfile: "{{ seccompProfile }}"
configMap:
keyValuePairs: "{{ keyValuePairs }}"
imageRegistryCredentials:
- server: "{{ server }}"
username: "{{ username }}"
password: "{{ password }}"
passwordReference: "{{ passwordReference }}"
identity: "{{ identity }}"
identityUrl: "{{ identityUrl }}"
restartPolicy: "{{ restartPolicy }}"
ipAddress:
ports:
- protocol: "{{ protocol }}"
port: {{ port }}
type: "{{ type }}"
ip: "{{ ip }}"
dnsNameLabel: "{{ dnsNameLabel }}"
autoGeneratedDomainNameLabelScope: "{{ autoGeneratedDomainNameLabelScope }}"
fqdn: "{{ fqdn }}"
osType: "{{ osType }}"
volumes:
- name: "{{ name }}"
azureFile:
shareName: "{{ shareName }}"
readOnly: {{ readOnly }}
storageAccountName: "{{ storageAccountName }}"
storageAccountKey: "{{ storageAccountKey }}"
storageAccountKeyReference: "{{ storageAccountKeyReference }}"
emptyDir: "{{ emptyDir }}"
secret: "{{ secret }}"
secretReference: "{{ secretReference }}"
gitRepo:
directory: "{{ directory }}"
repository: "{{ repository }}"
revision: "{{ revision }}"
instanceView:
events:
- count: {{ count }}
firstTimestamp: "{{ firstTimestamp }}"
lastTimestamp: "{{ lastTimestamp }}"
name: "{{ name }}"
message: "{{ message }}"
type: "{{ type }}"
state: "{{ state }}"
diagnostics:
logAnalytics:
workspaceId: "{{ workspaceId }}"
workspaceKey: "{{ workspaceKey }}"
logType: "{{ logType }}"
metadata: "{{ metadata }}"
workspaceResourceId: "{{ workspaceResourceId }}"
subnetIds:
- id: "{{ id }}"
name: "{{ name }}"
dnsConfig:
nameServers:
- "{{ nameServers }}"
searchDomains: "{{ searchDomains }}"
options: "{{ options }}"
sku: "{{ sku }}"
encryptionProperties:
vaultBaseUrl: "{{ vaultBaseUrl }}"
keyName: "{{ keyName }}"
keyVersion: "{{ keyVersion }}"
identity: "{{ identity }}"
initContainers:
- name: "{{ name }}"
properties:
image: "{{ image }}"
command:
- "{{ command }}"
environmentVariables:
- name: "{{ name }}"
value: "{{ value }}"
secureValue: "{{ secureValue }}"
secureValueReference: "{{ secureValueReference }}"
instanceView:
restartCount: {{ restartCount }}
currentState:
state: "{{ state }}"
startTime: "{{ startTime }}"
exitCode: {{ exitCode }}
finishTime: "{{ finishTime }}"
detailStatus: "{{ detailStatus }}"
previousState:
state: "{{ state }}"
startTime: "{{ startTime }}"
exitCode: {{ exitCode }}
finishTime: "{{ finishTime }}"
detailStatus: "{{ detailStatus }}"
events:
- count: {{ count }}
firstTimestamp: "{{ firstTimestamp }}"
lastTimestamp: "{{ lastTimestamp }}"
name: "{{ name }}"
message: "{{ message }}"
type: "{{ type }}"
volumeMounts:
- name: "{{ name }}"
mountPath: "{{ mountPath }}"
readOnly: {{ readOnly }}
securityContext:
privileged: {{ privileged }}
allowPrivilegeEscalation: {{ allowPrivilegeEscalation }}
capabilities:
add: "{{ add }}"
drop: "{{ drop }}"
runAsGroup: {{ runAsGroup }}
runAsUser: {{ runAsUser }}
seccompProfile: "{{ seccompProfile }}"
extensions:
- name: "{{ name }}"
properties:
extensionType: "{{ extensionType }}"
version: "{{ version }}"
settings: "{{ settings }}"
protectedSettings: "{{ protectedSettings }}"
confidentialComputeProperties:
ccePolicy: "{{ ccePolicy }}"
priority: "{{ priority }}"
identityAcls:
defaultAccess: "{{ defaultAccess }}"
acls:
- access: "{{ access }}"
identity: "{{ identity }}"
containerGroupProfile:
id: "{{ id }}"
revision: {{ revision }}
standbyPoolProfile:
id: "{{ id }}"
failContainerGroupCreateOnReuseFailure: {{ failContainerGroupCreateOnReuseFailure }}
isCreatedFromStandbyPool: {{ isCreatedFromStandbyPool }}
UPDATE examples
- update
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
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
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_outbound_network_dependencies_endpoints
- restart
- stop
- start
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
;
Restarts 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.
EXEC azure.container_instance.container_groups.restart
@resource_group_name='{{ resource_group_name }}' --required,
@container_group_name='{{ container_group_name }}' --required,
@subscription_id='{{ subscription_id }}' --required
;
Stops all containers in a container group. Stops all containers in a container group. Compute resources will be deallocated and billing will stop.
EXEC azure.container_instance.container_groups.stop
@resource_group_name='{{ resource_group_name }}' --required,
@container_group_name='{{ container_group_name }}' --required,
@subscription_id='{{ subscription_id }}' --required
;
Starts all containers in a container group. Starts all containers in a container group. Compute resources will be allocated and billing will start.
EXEC azure.container_instance.container_groups.start
@resource_group_name='{{ resource_group_name }}' --required,
@container_group_name='{{ container_group_name }}' --required,
@subscription_id='{{ subscription_id }}' --required
;