- Lab
-
Libraries: If you want this lab, consider one of these libraries.
- Cloud

Manage Hybrid Environments with Azure Arc
Azure Arc enables cloud-centric deployment and management capabilities for hybrid and multi-cloud servers. In this hands-on lab, you will onboard Linux servers at scale with Ansible and deploy extensions to Arc-enabled servers using Infrastructure as Code with Azure Bicep.

Lab Info
Table of Contents
-
Challenge
Onboard Linux Servers into Azure Arc at Scale Using Ansible
-
Connect to
LinuxVM1
using SSH. -
Log in to the Azure CLI from within
LinuxVM1
-
Download the Ansible playbook template by running the following command:
wget https://raw.githubusercontent.com/pluralsight-cloud/azure-arc-hybrid-management-implementing/refs/heads/main/LAB-Manage%20hybrid%20environments%20with%20Azure%20Arc/arc-server-onboard-playbook.yaml
-
Update the following placeholder values in the playbook:
service_principal_id
,service_principal_secret
,resource_group
,tenant_id
,subscription_id
, andlocation
. The followingsed
commands can be used to update theresource_group
,tenant_id
,subscription_id
, andlocation
values:sed -i "s/RESOURCE-GROUP/$(az group list --query '[].name' --output tsv)/" arc-server-onboard-playbook.yaml
sed -i "s/TENANT-ID/$(az account show --query tenantId --output tsv)/" arc-server-onboard-playbook.yaml
sed -i "s/SUBSCRIPTION-ID/$(az account show --query id --output tsv)/" arc-server-onboard-playbook.yaml
sed -i "s/LOCATION/$(az group list --query [].location --output tsv)/" arc-server-onboard-playbook.yaml
-
The
service_principal_id
andservice_principal_secret
values can be updated using the provided Service Principal in the lab details. -
Create an inventory of target machines for the Ansible playbook:
az vm list -d --query [].publicIps -o tsv > hosts
-
Add the SSH host keys to the
~/.ssh/known_hosts
file to establish trust:az vm list -d --query "[].publicIps" -o tsv | xargs -n 1 ssh-keyscan -H >> ~/.ssh/known_hosts
-
Run the Ansible playbook:
ansible-playbook arc-server-onboard-playbook.yaml -u cloud_user -i hosts --ask-pass
-
-
Challenge
Configure Arc-enabled Servers Using Azure Bicep
-
Download the provided Bicep file:
wget https://raw.githubusercontent.com/pluralsight-cloud/azure-arc-hybrid-management-implementing/refs/heads/main/LAB-Manage%20hybrid%20environments%20with%20Azure%20Arc/main.bicep
-
Deploy the Bicep template by running the following commands:
RG=$(az group list --query [].name --output tsv)
az deployment group create --resource-group $RG --template-file main.bicep
-
-
Challenge
Review the Resources Created by the Bicep Template
- Confirm the following resources have been deployed:
- A Data collection rule named
MSVMI-VMInsights
that is associated with the Arc-enabled machines namedLinuxVM1
andLinuxVM2
- Two extensions on each Arc-enabled Machine, the
AzureMonitorLinuxAgent
and the CustomScript extension - An Arc-enabled Kubernetes cluster named
Arc-Cluster-LinuxVM2
About the author
Real skill practice before real-world application
Hands-on Labs are real environments created by industry experts to help you learn. These environments help you gain knowledge and experience, practice without compromising your system, test without risk, destroy without fear, and let you learn from your mistakes. Hands-on Labs: practice your skills before delivering in the real world.
Learn by doing
Engage hands-on with the tools and technologies you’re learning. You pick the skill, we provide the credentials and environment.
Follow your guide
All labs have detailed instructions and objectives, guiding you through the learning process and ensuring you understand every step.
Turn time into mastery
On average, you retain 75% more of your learning if you take time to practice. Hands-on labs set you up for success to make those skills stick.