Azure: Deploy Docker containers with Azure CLI

Azure: Deploy Docker containers with Azure CLI

Login

Log in to your account

1
az login

Creating

Create a resource group

1
2
3
az group create \
-n kakoje_acs_rg1 \
-l "westus"

Create an ACS (Azure Container Service) cluster

1
2
3
4
az acs create \
--name kakoje-acs-cluster \
--resource-group kakoje_acs_rg1 \
--dns-prefix kakoje-app-9898

or use shorter syntax

1
2
3
4
az acs create \
-n kakoje-acs-cluster \
-g kakoje_acs_rg1 \
-d applink789

Managing

Manage ACS clusters

List clusters under a subscription

1
2
az acs list \
--output table

List clusters in a resource group

1
2
3
az acs list \
-g kakoje_acs_rg1 \
--output table

Display details of a container service cluster

1
2
3
4
az acs show \
-g kakoje_acs_rg1 \
-n kakoje-acs-cluster \
--output table

Display details of a container service cluster

1
2
3
4
az acs show \
-g kakoje_acs_rg1 \
-n kakoje-acs-cluster \
--output jsonc

Get username and FQDN

Now we get the username and FQDN in order to connect

1
2
3
4
az acs show \
-g kakoje_acs_rg1 \
-n kakoje-acs-cluster \
--output jsonc | grep 'user\|fqdn'

Scale the cluster

1
2
3
4
az acs scale \
-g kakoje_acs_rg1 \
-n acs-cluster \
--new-agent-count 4

Deleting

Delete a container service cluster

1
2
3
az acs delete \
-g kakoje_acs_rg1 \
-n acs-cluster

Delete Resource Group

1
2
az group delete \
-n kakoje_acs_rg1

Links

Resources