Tag: Machine

azcmagent utility

The Azure Arc Connected Machine Agent (Azcmagent)

Azure Arc enabled servers allows you to add on-premises servers or servers running on another cloud provider. The onboarding is done by installing the Azure connected machine agent or also called Azure Arc agent on the server. The Azure Arc agent can be installed on Windows Server or Linux. After the agent is installed you run a couple of commands to manage the machine. Here is how you can manage and maintain the Azure Connect Machine Agent (Azcmagent tool) for Azure Arc.

The Azure Connected Machine agent package contains several logical components:

  • The Hybrid Instance Metadata service (HIMDS) manages the connection to Azure and the connected machine’s Azure identity.
  • The Guest Configuration agent provides In-Guest Policy and Guest Configuration functionality, such as assessing whether the machine complies with required policies.
  • The Extension agent manages VM extensions, including install, uninstall, and upgrade.
Azure Arc Connected Machine Agent Component details
Azure Arc Connected Machine Agent Component details (Microsoft Docs)

You can find more information about the Azure Arc enabled servers agent on Microsoft Docs.

Installing the Azure Connected Machine Agent

To install the the Azure Connected Machine Agent (also known as Azure Arc agent) you have a couple of different options. Basically you need to follow these three steps:

  1. Download the agent – Windows agent Windows Installer package from the Microsoft Download Center and the Linux agent package is distributed from Microsoft’s package repository using the preferred package format for the distribution (.RPM or .DEB).
  2. Install the agent
  3. Register the Azure Arc enabled server with Microsoft Azure.

The Azure Arc agent currently supports the following operating systems (Keep in mind that the list is subject to change and you can find the official list here.

  • Windows Server 2008 R2, Windows Server 2012 R2 and higher (including Server Core)
  • Ubuntu 16.04 and 18.04 LTS (x64)
  • CentOS Linux 7 (x64)
  • SUSE Linux Enterprise Server (SLES) 15 (x64)
  • Red Hat Enterprise Linux (RHEL) 7 (x64)
  • Amazon Linux 2 (x64)
  • Oracle Linux 7

You can find more details about how to connect the Azure Arc enabled servers Connected Machine agent for Windows or Linux on Microsoft Docs.

Managing the Azure Arc Connected Machine agent

To manage the Azure Connected Machine Agent, also know as the Azure Arc Agent, you can use the Azcmagent tool.

azcmagent utility
azcmagent utility

Allows you to connect and disconnect the Azure Arc Connected Machine agent, but also provides you with additional information. You can run the utility with the “show” command, to get additional information such a the installed version, Azure information such as resource group, subscription, tenant, and much more. It also provides you with information for troubleshooting such a path to the log file and an overview of the state of the different agent components.

azcmagent show command
azcmagent show command

If you want to learn more about managing and maintaining the Azure Arc Connected Machine agent, check out the following Microsoft Docs article. You can also find more information on how to troubleshoot Azure Arc enabled servers agent connection issues here.

If you want to check the agent version of the connected machine agent, you can also do this at scale using Azure Resource Graph.

Conclusion

I hope this provides you with a quick overview on how to work with the agent. If you have any questions, feel free to leave a comment. Also check out my other blogs and Azure Arc content:



Automanage for Azure virtual machines

Automanage for Azure virtual machines

For me, one of the most impressive announcements at Microsoft Ignite, next to many of the Azure Arc and Azure Stack announcements, was the announcement of the Azure Automanage for virtual machines (VMs) public preview. As you know, Microsoft Azure offers many management services for Azure virtual machines (VMs). However, finding and configured these services can be some work. Azure Automanage for virtual machines helps to address precisely that. Azure Automanage for virtual machines is a service that eliminates the need to discover, know how to onboard, and how to configure certain services in Azure that would benefit your virtual machine.

UPDATE: Azure Automanage now also supports servers running outside of Azure (on-premises or other cloud providers) using Azure Arc. Check out my blog for more details: Azure Automanage for Arc enabled servers

In summary, Azure Automanage provides the following features to reduced cost by automating Windows Server management, improved workload uptime with optimized operations, and implementation of security best practices.

  • Intelligently onboards virtual machines to select best practices Azure services
  • Automatically configures each service per Azure best practices.
  • Monitors for drift and corrects for it when detected.
  • Provides a simple experience (point, click, set, forget)

You can find more information on Microsoft Docs.



List Azure Arc Machines Agent Version in Azure Cloud Shell

Get the Azure Connected Machine Agent (Azcmagent) Version

Azure Arc Enabled Servers just got another update enabling extensions. This also includes an updated version of the Azure Arc agent or Azure Connected Machine Agent (Azcmagent). To get an overview of what Azure Arc Azure Connected Machine Agent is installed on your machines, you can use several different ways. In this blog post, we are going to have a look at how you can get installed Azure Connected Machine Agent (Azcmagent) version for Azure Arc Enabled Servers.

On the Azure Arc Enabled Server

If you want to check the Azure Connected Machine Agent (Azcmagent) version directly on your Azure Arc enabled server, you can simply run the following command in PowerShell.

azcmagent version

This will list the installed version.

Azure Connected Machine Agent azcmagent Version

Azure Connected Machine Agent azcmagent Version

In the Azure Portal

You can also see the agent version in the Azure Portal. If you browse to your Azure Arc Enabled Server, you can find the agent version on the overview page.

Azure Portal - Azure Arc Enabled Server

Azure Portal – Azure Arc Enabled Server

However, if you want to see the agent version for your Azure Arc enabled servers at scale, this isn’t an ideal option.

List Azure Connected Machine Agent (Azcmagent) version for all Azure Arc machines

If you want to see the installed Azure Connected Machine Agent (Azcmagent) version for all your Azure Arce enabled servers at scale, you can use Azure Resource Graph Queries.

This query lists all the Azure Arc enabled machines and shows the installed agent version.

List Azure Arc Machines with Agent Version

List Azure Arc Machines with Agent Version

You can run the following query in the Azure Resource Graph Explorer in the Azure Portal.

 resources
| where type == "microsoft.hybridcompute/machines"
| extend agentversion = properties.agentVersion
| project name, agentversion, location, resourceGroup, subscriptionId
| order by name

You can also run the query directly in Azure Cloud Shell or on your local machine using Azure PowerShell or the Azure CLI.

List Azure Arc Machines Agent Version in Azure Cloud Shell

List Agent Version in Azure Cloud Shell

Azure CLI

az graph query -q "Resources | where type =~ 'microsoft.hybridcompute/machines' | extend agentversion = properties.agentVersion | project name, agentversion, location, resourceGroup, subscriptionId"

Azure PowerShell

Search-AzGraph -Query "Resources | where type =~ 'microsoft.hybridcompute/machines' | extend agentversion = properties.agentVersion | project name, agentversion, location, resourceGroup, subscriptionId"

If you need an overview of what Azure Connected Machine Agents we have installed and which versions do exist in our environment, you can just use the following Azure Resource Graph query.

Azure Resource Graph Explorer Chart - Azure Arc Server Agent Version

Azure Resource Graph Explorer Chart

Azure Resource Graph Explorer

 resources
| where type == "microsoft.hybridcompute/machines"
| extend agentversion = properties.agentVersion
| summarize count() by tostring(agentversion)

Azure PowerShell

Search-AzGraph -Query "Resources | where type =~ 'microsoft.hybridcompute/machines' | summarize count() by tostring(properties.agentVersion)"

Azure CLI

az graph query -q "Resources | where type =~ 'microsoft.hybridcompute/machines' | summarize count() by tostring(properties.agentVersion)"

Conclusion

I hope this blog post provides you with a short overview of how you can make sure which agent versions you have installed on your Azure Arc enabled servers. To learn more about Azure Arc for servers, check out Microsoft Docs. If you have any questions, feel free to leave a comment.