In this small demo environment I would like to show how easy it is to integrate a Virtual Machine into Azure Arc.
There are countless Github repositories that can be used to build a demo environment in Azure. I choose a repository that allows me to have multiple options at the same time. This repository deployed with Azure Bicep various Hub and Spoke networks. Therefore, I also saved myself the time and did not create a separate repository for it.
Put the right things together! ;-)
In this step we will create the basic environment in Azure.
For this we need:
- one Hub Network
- one Spoke Network (for simulated OnPrem Hybrid connectivity)
- one Virtual Machine (Windows) in Spoke Network (OnPrem)
I use the Bastian Host for connecting to the Arc Windows VM in the Spoke Network instead of an Public IP.
Description | Template |
---|---|
Deploy to Azure Subscription |
⚠️ Warning: This deployment is meant for Demo, Test, Learning, Training, Practice or Reproduction purposes ONLY!! Please don't deploy to production environments!!
Note The original Repo is here: https://github.com/PieterbasNagengast/Azure-HubSpoke-LabBuilder
Step | Screenshot |
---|---|
Fill out as shown | ![]() |
Fill out as shown | ![]() |
No Spoke VNet | |
Fill out as shown | ![]() |
One VM in Spoke OnPrem | ![]() |
Admin Credentials | ![]() |
Setup Tags | fill out, what you want |
Validate and Deploy | click ;-) |
Note The original Repo is here: https://azurearcjumpstart.io/azure_arc_jumpstart/azure_arc_servers/azure/azure_arm_template_win/
az login
Select your Subscription and create your SP
az ad sp create-for-rbac -n "ArcSP" --role "Contributor" --scopes /subscriptions/$subscriptionId
In the next step you have to register some (three) Azure Provider on your subscription. (only for the first time)
az provider register --namespace 'Microsoft.HybridCompute'
az provider register --namespace 'Microsoft.GuestConfiguration'
az provider register --namespace 'Microsoft.HybridConnectivity'
With Azure Bastion you can now logon to your Windows VM. Next step is to use this script (https://github.com/chtwilfer/Arc-enabledWinServersDemoLab/main/install_arc_agent.ps1) with Powershell and admin rights to create another script with which you can start the onboarding to Azure Arc.
Copy and paste "install_arc_agent.ps1" to your Windows VM and start the script with admin rights. After starting the script you have to fill these parameters:
$subscriptionId,
$appId,
$password, (=> AppID password)
$tenantId,
$resourceGroup,
$location,
$adminUsername
Now there is an new folder on C:\temp. In this folder there is a new "OnboardArc.ps1". With this script you are now able to onboard this VM to Azure Arc.
Two options in the end: First to reboot the VM and the "OnboardArc" Script will start automatically at the next logon, or you can start the script by yourself with Powershell and admin rights. :-)
Just a quick moment and you can see your VM in Azure Arc.