Hybrid and Multi-Cloud Management with Azure Arc

Published:29 June 2022 - 8 min. read

Nicholas Xuan Nguyen Image

Nicholas Xuan Nguyen

Read more tutorials by Nicholas Xuan Nguyen!

So you have a hybrid or multi-cloud deployments. Maintaining security and compliance across multiple environments while keeping track of costs can quickly become a nightmare. If only there were a way to manage these mixed environments in a uniform system seamlessly.

Lucky for you, there is Azure Arc that provides central management of resources deployed on-premises or in other cloud providers. Even better—you’ll learn how to use Azure Arc to manage a hybrid or multi-cloud environment in this tutorial.

Prerequisites

This tutorial will be a hands-on demonstration. If you’d like to follow along, be sure you have the following.

  • An Azure account with an active subscription. You can create one for free if you don’t have one.
  • An on-premises Linux machine or a Linux server in any other cloud provider. This guide uses an on-premises Ubuntu 18.04.
  • The firewall (if any) on your server must allow port 443 so the Azure Arc agent can communicate with Azure via HTTPS.

Registering Azure Resource Providers

In preparation to use Azure Arc in managing your mixed environments, you’ll be using two Azure Resource Providers:

Microsoft.HybridCompute – This resource provider is for hybrid machine resources.

Microsoft.GuestConfiguration – Enables configuring of Azure Policy on non-Azure (Guest) machines.

But before you can use these resource providers, you must register them first to your Azure subscription. You can register Azure Resource Providers in the Azure Portal, PowerShell, or Azure CLI. In this tutorial, you will use PowerShell in the Azure Cloud Shell.

The following steps show you how to register resource providers.

1. Open a web browser and log in to the Azure Cloud Shell with your credentials.

2. Select PowerShell as your preferred shell environment, not Bash.

Selecting the PowerShell environment
Selecting the PowerShell environment

3. Run the below command in the Cloud Shell to list all the Azure subscriptions associated with your account. The –output table parameter formats the output as a table in a human-readable way.

az account list --output table

You will see a list of Azure subscriptions associated with your account, as shown below.

Make a note of your subscription name or subscription ID. If you have multiple subscriptions, choose the one you’ll use in this tutorial.

Listing available Azure subscriptions
Listing available Azure subscriptions

4. Run the az account set –subscription command to set the subscription you want to use. Replace <subscription Name or ID> with the subscription name (or ID) you noted in the previous step.

az account set --subscription <subscription Name or ID>

5. Now that you’ve selected the subscription in which you’ll create the resources run the below commands to register the resource providers.

# Register the Azure Resource Providers
az provider register --namespace 'Microsoft.HybridCompute'
az provider register --namespace 'Microsoft.GuestConfiguration'
The resources
The resources

6. Lastly, run the below commands to confirm each resource provider’s registration status.

# Confirm that the registration state of each resource provider
az provider show -n Microsoft.HybridCompute --output table
az provider show -n Microsoft.GuestConfiguration --output table

Confirm that the RegistrationState says Registered, as you can see below.

If the value says Registering, the registration is still ongoing. Wait a few minutes and rerun the same commands.

Checking the resource provider registration status
Checking the resource provider registration status

Creating an Azure Arc Deployment Script

Now that you have registered all the necessary resource providers, you are ready to create an Arc script. An Arc script is a JSON file that contains the definition of an Azure resource. You’ll learn in this section to create an Azure Arc deployment script using the Azure Portal.

To create a deployment script, follow these steps.

1. Navigate to the Azure Arc – Servers blade in the Azure Portal.

2. Click the Add button to start adding the Azure Arc deployment script.

Click Add to create the Azure Arc deployment script
Click Add to create the Azure Arc deployment script

3. Since you’re only adding one server in this tutorial, click the Generate script button inside the Add a single sever card.

Adding a single server
Adding a single server

Other options are: * Add multiple servers – deploy the Arc agent on multiple machines. * Add servers from Update Management (preview) – deploy the Arc agent on non-Azure servers managed by the Update Management service. * Add servers with Azure Migrate – deploy the Arc agent on VMware vSphere servers using Azure Migrate.

4. On the Prerequisites step, leave the defaults and click Next.

Leave the prerequisites
Leave the prerequisites

5. On the Resource details step, specify the following details.

Subscription – The Azure subscription you want to use for this deployment.

Resource group – The resource group where you want to deploy the Arc agent.

Region – The Azure region you want to deploy the Arc agent. This region stores your Arc metadata.

Operating system – The operating system of the deployment target machine. The options are Windows and Linux. This example will select Linux.

Connectivity method – The connectivity method you want to use for this deployment. Select the Public endpoint option since this method doesn’t require network configuration.

The other methods, like Proxy server and Private endpoint, require network configuration, which is outside of the scope of this tutorial.

After completing the fields, click Next.

Specifying the resource details
Specifying the resource details

6. On the Tags step, leave the existing tags for now and click Next.

Adding Tags
Adding Tags

7. On the next screen, you will see the auto-generated script based on your provided information. Click the Download button to download this script. The default script filename is OnboardingScript.sh.

Downloading the Azure Arc deployment script
Downloading the Azure Arc deployment script

8. Lastly, copy the script to your on-premises Linux server. How you want to copy the script to the server is up to you. The command below copies the script via SCP to the /root folder on the Linux server. Change the target copy folder as you wish.

scp .\OnboardingScript.sh [email protected]:/root
Copying the Azure Arc deployment script to the on-premises Linux server
Copying the Azure Arc deployment script to the on-premises Linux server

Deploying the Azure Arc Agent

Now that you have the deployment script and copied it to your on-premises Linux server, it’s time to deploy the Azure Arc agent. To do so, follow these steps.

1. Login to your Linux server. Ensure that the user account has access to the script file’s directory.

2. Run the below command to update the local package list since you will be installing new packages.

apt update -y

3. Run the commands below to change the current directory to the deployment script path (/root) and execute the script (OnboardingScript.sh).

cd /root
bash OnboardingScript.sh

Wait for the script to show the below message instructing you to open the website in your browser and enter a code to authenticate.

Script asking for authentication
Script asking for authentication

4. Now, open your web browser and navigate to the Azure Device Login page. Enter the code you got from the script and click Next.

Authenticate your device
Authenticate your device

Once the authorization completes, you will see a Successfully Onboarded message on your terminal, as shown below.

Azure Arc agent deployment is successful
Azure Arc agent deployment is successful

5. Finally, open the Azure Arc – Servers blade using your web browser and confirm that the Linux server you onboarded is now visible on the servers list. As you can see below, there’s one Linux server named ubuntu on the list with the status of Connected.

Viewing the Azure Arc servers list
Viewing the Azure Arc servers list

Managing Azure Arc Servers

So you’ve completed the Linux server onboarding to Azure Arc. What now? Now you can start managing the on-premises Linux server in the Azure Portal, Azure CLI, or Azure PowerShell commands.

In this section, you will learn how to use Azure Portal to perform some common management tasks on your machine.

1. On the Azure Arc – Servers blade, click on your server name to open the server page.

2. Click on Insights under the Monitoring, and click Enable.

Enabling monitoring insights
Enabling monitoring insights

3. The following prompt will ask you to choose the Azure subscription, where you’ll store the monitoring data. Leave the defaults and click Enable.

Selecting the subscription workspace
Selecting the subscription workspace

4. Wait for several minutes, and you should start seeing some data appearing on the insights page, such as the CPU and RAM utilization.

Seeing data appearing on the insights page
Seeing data appearing on the insights page

5. Click on the Map tab. You will notice a big map in the middle of the screen, as shown below. The interesting thing about this map is that various elements are interactive.

For example, click on the Clients object to reveal the client IP addresses connecting to your server.

Showing the client IP addresses
Showing the client IP addresses

Next, click on the Processes object to show all running processes on your Linux server.

Showing all running processes
Showing all running processes

6. Next, click View Workbooks —> Performance.

Open the performance analysis workbook
Open the performance analysis workbook

And you should see the Performance Analysis trend chart of the server.

Viewing your Performance Analysis trend
Viewing your Performance Analysis trend

Further to the bottom of the page, you’ll see the CPU and Memory Performance Charts.

Viewing CPU and Memory Performance Charts
Viewing CPU and Memory Performance Charts

Conclusion

In this guide, you learned to install and configure the Azure Arc agent for hybrid and multi-cloud management. You also learned how to use Azure Portal to perform common management tasks on your Azure Arc-enabled machines.

With Azure Arc, you can now manage your on-premises machines and resources consistently as you would do with any other Azure resource. This solution can encourage and drive the adoption of hybrid and multi-cloud strategies.

Take your time to experiment with Azure Arc and explore all the features it has to offer. And when you’re ready, dive into other Azure tutorials to connect your hybrid and multi-cloud resources at scale.

Hate ads? Want to support the writer? Get many of our tutorials packaged as an ATA Guidebook.

Explore ATA Guidebooks

Looks like you're offline!