Setting Up an Azure Container Registry

Microsoft Azure uses the Azure Container Registry for securely storing docker images of your application. To create an Azure Container Registry, you must create an Azure Resource group. An Azure resource group is a logical grouping in which Azure resources are deployed and managed.

For more information about commands used in the following procedure, see Microsoft Azure CLI documentation.
Before you begin
    Procedure
  1. Create a resource group.
    • Using the Azure Portal: See Create resource groups.
    • Using the Azure CLI: Run the following command:
      az group create --name ResourceGroupName --location RegionName
      For example, create a new resource group in the East US region.
      az group create --name mdmresourcegroup --location eastus
  2. Create virtual network by using the Azure portal and ensure that all resources are created under the same virtual network.

  3. Create a new managed Kubernetes cluster.
    • Using the Azure Portal: See Create an AKS cluster.
    • Using the Azure CLI: Run the following command:
      az aks create -g ResourceGroupName -n resourcegroupclustername --location RegionName --node-vm-size size --node-count nodecount --generate-ssh-keys
      For example, create a kubernetes cluster with the default vm size (Standard) and default node pool.
      az aks create -g mdmresourcegroup -n mdmcluster --location eastus --node-vm-size Standard_DS3_v2 --node-count 3 --generate-ssh-keys
  4. Create an Azure Container Registry instance in your resource group by using the az acr create command.
    • Using the Azure Portal: See Create a container registry.
    • Using the Azure CLI: Run the following command:
      az acr create --resource-group ResourceGroupName --name RegistryName --sku Basic
      For example, create a managed container registry with the Basic SKU.
       az acr create --resource-group mdmresourcegroup --name mdmregistry --sku Basic
  5. Log in to the container registry created earlier.
    • Using the Azure Portal: See Log in to registry.
    • Using the Azure CLI: Run the following command:
      az acr login --name acrName
      For example, log in to the specified Azure Container Registry.
       az acr login --name mdmregistry
    The command returns a Login Succeeded message after completed.
What to do next
  1. Push the application image to the registry. See Tag and Push the Docker Image for Cloud Platforms.
  2. Deploy the Kubernetes cluster on Microsoft Azure. See Setting Up a Kubernetes Cluster on AKS