Sitemap

Deploy Azure Arc resources on Azure Local with Azure Bicep šŸ”„

4 min readJan 13, 2025

--

Zoom image will be displayed

Recently, I’ve been experimenting with Azure Local in my home lab, where I have a cluster with two nodes (physically, this is one server with two nested nodes and one DC). While it’s possible to navigate through the portal to deploy Azure Arc resources on Azure Local, why not take it up a notch and use Infrastructure as Code (IaC)? Today, I’ll demonstrate how to deploy Azure Arc resources, such as VM images, VMs, and Kubernetes (K8S) clusters on Azure Local using Azure Bicep. šŸ’ŖšŸ»

We can see the two nodes up and running as part of the Azure Local Cluster. The domain controller handles Active Directory (AD) and internal routing using RRAS.

The Azure Local cluster containing the 2 nodes in the Azure Portal.

Zoom image will be displayed

The custom location is called azlocal-038-location. We need this information for our Bicep deployment.

Zoom image will be displayed

Before deploying an Arc VM on Azure Local, we need an image. I’ve created an Azure Bicep template to deploy the image.

Execute the Bicep deployment to create an image.

location="westeurope"
templateFile="main.bicep"
resourceGroup="rg-local-prod"

az deployment group create --resource-group $resourceGroup --template-file $templateFile
Zoom image will be displayed

In the backend, it downloads the image and stores it in one of our User Storage locations as part of the Cluster Virtual Disks.

Zoom image will be displayed

We can verify this by checking the Cluster Storage.

Now that we have a VM image, how can we deploy a VM based on it? Well, I’ve got another Bicep template to cover that! ✨ The main.bicep template serves as the entry point for our Bicep configuration. It defines the parameters and variables used across the VM module-file.

The vm.bicep module file is responsible for deploying the VM.

Let’s run the deployment of the Arc VM on Azure Local using the image we just deployed using Bicep.

Zoom image will be displayed

Just grab a coffee; we need to wait for a little while. ā˜•

Zoom image will be displayed

We can see that vm-a-l-t-001 is deployed and is hosted on the node 00-HCI-1. It is operating normally as expected.

Zoom image will be displayed

We can also see the vm-a-l-t-001 from the Azure Portal.

Zoom image will be displayed

I can even visit my own website from the Arc VM on Azure Local. Isn’t that awesome? 🤪

Zoom image will be displayed

Time to flex our Biceps and deploy an AKS Cluster on Azure Local using Azure Bicep. šŸ’ŖšŸ» The main.bicep template serves as the entry point for our Bicep configuration. It defines the parameters and variables used across the AKS module-file.

The aks.bicep module file is responsible for deploying the AKS Cluster.

Let’s run the Bicep deployment for our AKS cluster.

Zoom image will be displayed

Once the AKS cluster is deployed, you’ll notice two additional VMs on the node. This is because one VM handles the control plane of the AKS cluster, while the other runs the AKS node pool.

Zoom image will be displayed

Also the AKS Azure Arc resource is visible within Azure.

Zoom image will be displayed

We can connect to our k8s cluster using the Cloud Shell az connectedk8s proxy -n aks-ct01-prod -g rg-local-aks-prod .

Zoom image will be displayed

For example we can retrieve the existing nodes. šŸ”„

Zoom image will be displayed

Azure Local is fantastic! Now, I can run low-latency-sensitive workloads right next to my operations and manage all the infrastructure within Azure using Azure Bicep. That’s all for today! Feel free to share your feedback, and I look forward to our next session. Until then, take care! šŸ’›

--

--

Brian Veldman
Brian Veldman

Written by Brian Veldman

Microsoft MVP who is passionate about Azure, DevOps, Identity, Access and Infrastructure as Code. šŸš€

Responses (1)