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

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

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

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.

## Path parameters

- `subscriptionId` string, required
- `resourceGroupName` 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, required — The resource location.
    - `tags` object — The resource tags.
    - `properties` object, required
      - `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.
            - `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, required — The value of the 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` ContainerEvent[] — 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.
      - `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, required — The username for the private registry.
        - `password` string — The password for the private registry.
      - `restartPolicy` 'always' — Restart policy for all containers within the container group. Currently the only available option is `always`.
      - `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', required — Specifies if the IP is exposed to the public internet.
        - `ip` string — The IP exposed to the public internet.
      - `osType` 'Windows' | 'Linux', required — The operating system type required by the containers in the container group.
      - `state` string — The current state of the container group. This is only valid for the response.
      - `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, required — 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.
  - `nextLink` string — The URI to fetch the next page of container groups.

---

[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/f5d76c013607/schema)
