---
title: "Get a list of container groups in the specified subscription."
method: GET
path: "/subscriptions/{subscriptionId}/providers/Microsoft.ContainerInstance/containerGroups"
---

# Get a list of container groups in the specified subscription.

`GET /subscriptions/{subscriptionId}/providers/Microsoft.ContainerInstance/containerGroups`

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.

## Path parameters

- `subscriptionId` string, required

## Query parameters

- `api-version` string, required

## Response `200`

OK

- ContainerGroupListResult — The container group list response that contains the container group properties.
  - `value` ContainerGroup[] — The list of container groups.
    - `id` string — The resource id.
    - `name` string — The resource name.
    - `type` string — The resource type.
    - `location` string — The resource location.
    - `tags` object — The resource tags.
    - `zones` string[] — The zones for the container group.
    - `identity` ContainerGroupIdentity — Identity for the container group.
      - `principalId` string — The principal id of the container group identity. This property will only be provided for a system assigned identity.
      - `tenantId` string — The tenant id associated with the container group. This property will only be provided for a system assigned identity.
      - `type` 'SystemAssigned' | 'UserAssigned' | 'SystemAssigned, UserAssigned' | 'None' — 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.
      - `userAssignedIdentities` object — The list of user identities associated with the container group.
    - `properties` object, required — The container group properties
      - `provisioningState` string — The provisioning state of the container group. This only appears in the response.
      - `containers` Container[], required — The containers within the container group.
        - `name` string, required — The user-provided name of the container instance.
        - `properties` ContainerProperties, required — The container instance properties.
          - `image` string, required — The name of the image used to create the container instance.
          - `command` string[] — The commands to execute within the container instance in exec form.
          - `ports` ContainerPort[] — The exposed ports on the container instance.
            - `protocol` 'TCP' | 'UDP' — The protocol associated with the port.
            - `port` integer, required — The port number exposed within the container group.
          - `environmentVariables` EnvironmentVariable[] — The environment variables to set in the container instance.
            - `name` string, required — The name of the environment variable.
            - `value` string — The value of the environment variable.
            - `secureValue` string — The value of the secure environment variable.
          - `instanceView` object — The instance view of the container instance. Only valid in response.
            - `restartCount` integer — The number of times that the container instance has been restarted.
            - `currentState` ContainerState — The container instance state.
              - …
            - `previousState` ContainerState — The container instance state.
              - …
            - `events` Event[] — The events of the container instance.
              - …
          - `resources` ResourceRequirements, required — The resource requirements.
            - `requests` ResourceRequests, required — The resource requests.
              - …
            - `limits` ResourceLimits — The resource limits.
              - …
          - `volumeMounts` VolumeMount[] — The volume mounts available to the container instance.
            - `name` string, required — The name of the volume mount.
            - `mountPath` string, required — The path within the container where the volume should be mounted. Must not contain colon (:).
            - `readOnly` boolean — The flag indicating whether the volume mount is read-only.
          - `livenessProbe` ContainerProbe — The container probe, for liveness or readiness
            - `exec` ContainerExec — The container execution command, for liveness or readiness probe
              - …
            - `httpGet` ContainerHttpGet — The container Http Get settings, for liveness or readiness probe
              - …
            - `initialDelaySeconds` integer — The initial delay seconds.
            - `periodSeconds` integer — The period seconds.
            - `failureThreshold` integer — The failure threshold.
            - `successThreshold` integer — The success threshold.
            - `timeoutSeconds` integer — The timeout seconds.
          - `readinessProbe` ContainerProbe — The container probe, for liveness or readiness
            - `exec` ContainerExec — The container execution command, for liveness or readiness probe
              - …
            - `httpGet` ContainerHttpGet — The container Http Get settings, for liveness or readiness probe
              - …
            - `initialDelaySeconds` integer — The initial delay seconds.
            - `periodSeconds` integer — The period seconds.
            - `failureThreshold` integer — The failure threshold.
            - `successThreshold` integer — The success threshold.
            - `timeoutSeconds` integer — The timeout seconds.
      - `imageRegistryCredentials` ImageRegistryCredential[] — The image registry credentials by which the container group is created from.
        - `server` string, required — The Docker image registry server without a protocol such as "http" and "https".
        - `username` string — The username for the private registry.
        - `password` string — The password for the private registry.
        - `identity` string — The identity for the private registry.
        - `identityUrl` string — The identity URL for the private registry.
      - `restartPolicy` 'Always' | 'OnFailure' | 'Never' — Restart policy for all containers within the container group. - `Always` Always restart - `OnFailure` Restart on failure - `Never` Never restart
      - `ipAddress` IpAddress — IP address for the container group.
        - `ports` Port[], required — The list of ports exposed on the container group.
          - `protocol` 'TCP' | 'UDP' — The protocol associated with the port.
          - `port` integer, required — The port number.
        - `type` 'Public' | 'Private', required — Specifies if the IP is exposed to the public internet or private VNET.
        - `ip` string — The IP exposed to the public internet.
        - `dnsNameLabel` string — The Dns name label for the IP.
        - `fqdn` string — The FQDN for the IP.
      - `osType` 'Windows' | 'Linux', required — The operating system type required by the containers in the container group.
      - `volumes` Volume[] — The list of volumes that can be mounted by containers in this container group.
        - `name` string, required — The name of the volume.
        - `azureFile` AzureFileVolume — The properties of the Azure File volume. Azure File shares are mounted as volumes.
          - `shareName` string, required — The name of the Azure File share to be mounted as a volume.
          - `readOnly` boolean — The flag indicating whether the Azure File shared mounted as a volume is read-only.
          - `storageAccountName` string, required — The name of the storage account that contains the Azure File share.
          - `storageAccountKey` string — The storage account access key used to access the Azure File share.
        - `emptyDir` EmptyDirVolume — The empty directory volume.
        - `secret` SecretVolume — The secret volume.
        - `gitRepo` GitRepoVolume — Represents a volume that is populated with the contents of a git repository
          - `directory` string — 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, required — Repository URL
          - `revision` string — Commit hash for the specified revision.
      - `instanceView` object — The instance view of the container group. Only valid in response.
        - `events` Event[] — The events of this container group.
          - `count` integer — The count of the event.
          - `firstTimestamp` string, date-time — The date-time of the earliest logged event.
          - `lastTimestamp` string, date-time — The date-time of the latest logged event.
          - `name` string — The event name.
          - `message` string — The event message.
          - `type` string — The event type.
        - `state` string — The state of the container group. Only valid in response.
      - `diagnostics` ContainerGroupDiagnostics — Container group diagnostic information.
        - `logAnalytics` LogAnalytics — Container group log analytics information.
          - `workspaceId` string, required — The workspace id for log analytics
          - `workspaceKey` string, required — The workspace key for log analytics
          - `logType` 'ContainerInsights' | 'ContainerInstanceLogs' — The log type to be used.
          - `metadata` object — Metadata for log analytics.
          - `workspaceResourceId` string — The workspace resource id for log analytics
      - `subnetIds` ContainerGroupSubnetId[] — The subnet resource IDs for a container group.
        - `id` string, required — Resource ID of virtual network and subnet.
        - `name` string — Friendly name for the subnet.
      - `dnsConfig` DnsConfiguration — DNS configuration for the container group.
        - `nameServers` string[], required — The DNS servers for the container group.
        - `searchDomains` string — The DNS search domains for hostname lookup in the container group.
        - `options` string — The DNS options for the container group.
      - `sku` 'Standard' | 'Dedicated' — The container group SKU.
      - `encryptionProperties` EncryptionProperties — The container group encryption properties.
        - `vaultBaseUrl` string, required — The keyvault base url.
        - `keyName` string, required — The encryption key name.
        - `keyVersion` string, required — The encryption key version.
      - `initContainers` InitContainerDefinition[] — The init containers for a container group.
        - `name` string, required — The name for the init container.
        - `properties` InitContainerPropertiesDefinition, required — The init container definition properties.
          - `image` string — The image of the init container.
          - `command` string[] — The command to execute within the init container in exec form.
          - `environmentVariables` EnvironmentVariable[] — The environment variables to set in the init container.
            - `name` string, required — The name of the environment variable.
            - `value` string — The value of the environment variable.
            - `secureValue` string — The value of the secure environment variable.
          - `instanceView` object — The instance view of the init container. Only valid in response.
            - `restartCount` integer — The number of times that the init container has been restarted.
            - `currentState` ContainerState — The container instance state.
              - …
            - `previousState` ContainerState — The container instance state.
              - …
            - `events` Event[] — The events of the init container.
              - …
          - `volumeMounts` VolumeMount[] — The volume mounts available to the init container.
            - `name` string, required — The name of the volume mount.
            - `mountPath` string, required — The path within the container where the volume should be mounted. Must not contain colon (:).
            - `readOnly` boolean — The flag indicating whether the volume mount is read-only.
  - `nextLink` string — The URI to fetch the next page of container groups.

## Other responses

- `default` — Error response describing why the operation failed.

---

[API](https://skmtc.dev/azure/apis/containerinstance-microsoft-containerinstance-containerinsta.md) · [All operations](https://skmtc.dev/azure/apis/containerinstance-microsoft-containerinstance-containerinsta/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/azure/containerinstance-microsoft-containerinstance-containerinsta/revisions/d53aa146186d/schema)
