Creating an Azure Kubernetes cluster with an attached Azure Container Registry with Bicep

Learn how you can use Bicep to provision AKS clusters, ACR registries and role assignments to enable your AKS cluster to pull images from ACR

Will Velida
8 min readSep 12, 2022

Azure Kubernetes Service (AKS) simplifies deploying a managed Kubernetes cluster into Azure by offloading the operational overhead to Azure. Azure Container Registry allows you to build, store and manage container images in a private registry, from which you can pull your images into your AKS cluster.

Azure Container Registry integrates with AKS. We can attach container registries to our AKS clusters using an Azure Active Directory managed identity. We can then assign that managed identity will the AcrPull role assignment that allows our AKS cluster to pull images from our Azure Container Registry.

In this article, we’ll create our AKS cluster, Azure Container Registry and role assignments in Bicep, deploy it to Azure, build a container image that we’ll push into our private registry and then create the manifest file containing the Kubernetes objects that we’ll need to run the application we packaged into our container image.

--

--

Will Velida
Will Velida

Written by Will Velida

Lead Software Engineer at Azenix | Ex-MSFT | International Conference Speaker. | GitHub: https://github.com/willvelida

No responses yet