Hamburger Icon
  • Labs icon Lab
  • Cloud
Azure icon
Labs

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.

Azure icon
Labs

Path Info

Level
Clock icon Advanced
Duration
Clock icon 1h 0m
Published
Clock icon Feb 18, 2025

Contact sales

By filling out this form and clicking submit, you acknowledge our privacy policy.

Table of Contents

  1. Challenge

    Onboard Linux Servers into Azure Arc at Scale Using Ansible

    1. Connect to LinuxVM1 using SSH.

    2. Log in to the Azure CLI from within LinuxVM1

    3. 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

    4. Update the following placeholder values in the playbook: service_principal_id, service_principal_secret, resource_group, tenant_id, subscription_id, and location. The following sed commands can be used to update the resource_group, tenant_id, subscription_id, and location 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

    5. The service_principal_id and service_principal_secret values can be updated using the provided Service Principal in the lab details.

    6. Create an inventory of target machines for the Ansible playbook:

      az vm list -d --query [].publicIps -o tsv > hosts

    7. 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

    8. Run the Ansible playbook:

      ansible-playbook arc-server-onboard-playbook.yaml -u cloud_user -i hosts --ask-pass

  2. Challenge

    Configure Arc-enabled Servers Using Azure Bicep

    1. 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

    2. 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

  3. Challenge

    Review the Resources Created by the Bicep Template

    1. Confirm the following resources have been deployed:
    • A Data collection rule named MSVMI-VMInsights that is associated with the Arc-enabled machines named LinuxVM1 and LinuxVM2
    • Two extensions on each Arc-enabled Machine, the AzureMonitorLinuxAgent and the CustomScript extension
    • An Arc-enabled Kubernetes cluster named Arc-Cluster-LinuxVM2

The Cloud Content team comprises subject matter experts hyper focused on services offered by the leading cloud vendors (AWS, GCP, and Azure), as well as cloud-related technologies such as Linux and DevOps. The team is thrilled to share their knowledge to help you build modern tech solutions from the ground up, secure and optimize your environments, and so much more!

What's a lab?

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.

Provided environment for hands-on practice

We will provide the credentials and environment necessary for you to practice right within your browser.

Guided walkthrough

Follow along with the author’s guided walkthrough and build something new in your provided environment!

Did you know?

On average, you retain 75% more of your learning if you get time for practice.