Azure Container API Documentation

Comprehensive guide to interacting with Azure Container Services

Container API Reference

This section details the RESTful APIs available for managing your Azure container resources. You can use these APIs to programmatically create, configure, and manage your container deployments.

Container Instances

APIs for managing individual container instances.

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

Retrieves the details of a specific container group.

Parameters

Name Type Description Required
subscriptionId string The Azure subscription ID. Yes
resourceGroupName string The name of the resource group. Yes
containerGroupName string The name of the container group. Yes

Responses

Status Code Description Schema
200 OK Successfully retrieved container group details. ContainerGroup (JSON)
404 Not Found Container group not found. ErrorResponse (JSON)
POST /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerInstance/containerGroups

Creates or updates a container group.

Parameters

Name Type Description Required
subscriptionId string The Azure subscription ID. Yes
resourceGroupName string The name of the resource group. Yes

Request Body

ContainerGroup (JSON)

Defines the properties of the container group.

{
    "location": "eastus",
    "name": "mycontainergroup",
    "properties": {
        "containers": [
            {
                "name": "mycontainer",
                "properties": {
                    "image": "mcr.microsoft.com/azuredocs/aci-helloworld",
                    "ports": [
                        {
                            "port": 80,
                            "protocol": "TCP"
                        }
                    ],
                    "resources": {
                        "requests": {
                            "cpu": 1.0,
                            "memoryInGB": 1.5
                        }
                    }
                }
            }
        ],
        "osType": "Linux",
        "ipAddress": {
            "type": "Public",
            "ports": [
                {
                    "port": 80,
                    "protocol": "TCP"
                }
            ]
        }
    }
}

Responses

Status Code Description Schema
200 OK Container group created or updated successfully. ContainerGroup (JSON)
201 Created Container group resource created. ContainerGroup (JSON)
400 Bad Request Invalid request payload. ErrorResponse (JSON)
DELETE /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerInstance/containerGroups/{containerGroupName}

Deletes a container group.

Parameters

Name Type Description Required
subscriptionId string The Azure subscription ID. Yes
resourceGroupName string The name of the resource group. Yes
containerGroupName string The name of the container group. Yes

Responses

Status Code Description Schema
204 No Content Container group deleted successfully. -
404 Not Found Container group not found. ErrorResponse (JSON)

Container Registries

APIs for managing Azure Container Registry instances.

GET /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}

Retrieves the details of a specific container registry.

Parameters

Name Type Description Required
subscriptionId string The Azure subscription ID. Yes
resourceGroupName string The name of the resource group. Yes
registryName string The name of the container registry. Yes

Responses

Status Code Description Schema
200 OK Successfully retrieved container registry details. Registry (JSON)
404 Not Found Container registry not found. ErrorResponse (JSON)
POST /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries

Creates or updates a container registry.

Parameters

Name Type Description Required
subscriptionId string The Azure subscription ID. Yes
resourceGroupName string The name of the resource group. Yes

Request Body

Registry (JSON)

Defines the properties of the container registry.

{
    "location": "eastus",
    "name": "mycontainerregistry",
    "sku": {
        "name": "Basic"
    },
    "properties": {
        "adminUserEnabled": false
    }
}

Responses

Status Code Description Schema
200 OK Container registry created or updated successfully. Registry (JSON)
201 Created Container registry resource created. Registry (JSON)
400 Bad Request Invalid request payload. ErrorResponse (JSON)

Kubernetes Services (AKS)

APIs for managing Azure Kubernetes Service (AKS) clusters.

GET /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}

Retrieves the details of a specific AKS managed cluster.

Parameters

Name Type Description Required
subscriptionId string The Azure subscription ID. Yes
resourceGroupName string The name of the resource group. Yes
resourceName string The name of the AKS managed cluster. Yes

Responses

Status Code Description Schema
200 OK Successfully retrieved AKS cluster details. ManagedCluster (JSON)
404 Not Found AKS cluster not found. ErrorResponse (JSON)