You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Reference for the YAML file supported by Azure Container Instances to configure a container group
tomvcassidy
reference
azure-container-instances
container-instances
tomcassidy
06/06/2022
YAML reference: Azure Container Instances
This article covers the syntax and properties for the YAML file supported by Azure Container Instances to configure a container group. Use a YAML file to input the group configuration to the az container create command in the Azure CLI.
A YAML file is a convenient way to configure a container group for reproducible deployments. It's a concise alternative to using a Resource Manager template or the Azure Container Instances SDKs to create or update a container group.
Note
This reference applies to YAML files for Azure Container Instances REST API version 2021-10-01.
Schema
The schema for the YAML file follows, including comments to highlight key properties. For a description of the properties in this schema, see the Property values section.
name: string # Name of the container groupapiVersion: '2021-10-01'location: stringtags: {}identity:
type: stringuserAssignedIdentities: {}properties: # Properties of container groupcontainers: # Array of container instances in the group
- name: string # Name of an instanceproperties: # Properties of an instanceimage: string # Container image used to create the instancecommand:
- stringports: # External-facing ports exposed on the instance, must also be set in group ipAddress property
- protocol: stringport: integerenvironmentVariables:
- name: stringvalue: stringsecureValue: stringresources: # Resource requirements of the instancerequests:
memoryInGB: numbercpu: numbergpu:
count: integersku: stringlimits:
memoryInGB: numbercpu: numbergpu:
count: integersku: stringvolumeMounts: # Array of volume mounts for the instance
- name: stringmountPath: stringreadOnly: booleanlivenessProbe:
exec:
command:
- stringhttpGet:
httpHeaders:
- name: stringvalue: stringpath: stringport: integerscheme: stringinitialDelaySeconds: integerperiodSeconds: integerfailureThreshold: integersuccessThreshold: integertimeoutSeconds: integerreadinessProbe:
exec:
command:
- stringhttpGet:
httpHeaders:
- name: stringvalue: stringpath: stringport: integerscheme: stringinitialDelaySeconds: integerperiodSeconds: integerfailureThreshold: integersuccessThreshold: integertimeoutSeconds: integerimageRegistryCredentials: # Credentials to pull a private image
- server: stringusername: stringpassword: stringidentity: stringidentityUrl: stringrestartPolicy: stringipAddress: # IP address configuration of container groupports:
- protocol: stringport: integertype: stringip: stringdnsNameLabel: stringdnsNameLabelReusePolicy: stringosType: stringvolumes: # Array of volumes available to the instances
- name: stringazureFile:
shareName: stringreadOnly: booleanstorageAccountName: stringstorageAccountKey: stringemptyDir: {}secret: {}gitRepo:
directory: stringrepository: stringrevision: stringdiagnostics:
logAnalytics:
workspaceId: stringworkspaceKey: stringworkspaceResourceId: stringlogType: stringmetadata: {}subnetIds: # Subnet to deploy the container group into
- id: stringname: stringdnsConfig: # DNS configuration for container groupnameServers:
- stringsearchDomains: stringoptions: stringsku: string # SKU for the container groupencryptionProperties:
vaultBaseUrl: stringkeyName: stringkeyVersion: stringinitContainers: # Array of init containers in the group
- name: stringproperties:
image: stringcommand:
- stringenvironmentVariables:
- name: stringvalue: stringsecureValue: stringvolumeMounts:
- name: stringmountPath: stringreadOnly: boolean
Property values
The following tables describe the values you need to set in the schema.
The type of identity used for the container group. The type 'SystemAssigned, UserAssigned' includes both an implicitly created identity and a set of user assigned identities. The type 'None' will remove any identities from the container group. - SystemAssigned, UserAssigned, SystemAssigned, UserAssigned, None
userAssignedIdentities
object
No
The list of user identities associated with the container group. The user identity dictionary key references will be Azure Resource Manager resource IDs in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'.
Restart policy for all containers within the container group. - Always Always restart- OnFailure Restart on failure- Never Never restart. - Always, OnFailure, Never
The protocol associated with the port. - TCP or UDP
port
integer
Yes
The port number.
AzureFileVolume object
Name
Type
Required
Value
shareName
string
Yes
The name of the Azure File share to be mounted as a volume.
readOnly
boolean
No
The flag indicating whether the Azure File shared mounted as a volume is read-only.
storageAccountName
string
Yes
The name of the storage account that contains the Azure File share.
storageAccountKey
string
No
The storage account access key used to access the Azure File share.
GitRepoVolume object
Name
Type
Required
Value
directory
string
No
Target directory name. Must not contain or start with '..'. If '.' is supplied, the volume directory will be the git repository. Otherwise, if specified, the volume will contain the git repository in the subdirectory with the given name.
repository
string
Yes
Repository URL
revision
string
No
Commit hash for the specified revision.
LogAnalytics object
Name
Type
Required
Value
workspaceId
string
Yes
The workspace ID for log analytics
workspaceKey
string
Yes
The workspace key for log analytics
workspaceResourceId
string
No
The workspace resource ID for log analytics
logType
enum
No
The log type to be used. - ContainerInsights or ContainerInstanceLogs
metadata
object
No
Metadata for log analytics.
InitContainerPropertiesDefinition object
Name
Type
Required
Value
image
string
No
The image of the init container.
command
array
No
The command to execute within the init container in exec form. - string
K80 and P100 GPU SKUs are retiring by August 31st, 2023. This is due to the retirement of the underlying VMs used: NC Series and NCv2 Series Although V100 SKUs will be available, it is receommended to use Azure Kubernetes Service instead. GPU resources are not fully supported and should not be used for production workloads. Use the following resources to migrate to AKS today: How to Migrate to AKS.