Azure Arc Management Tools
Managing Azure Arc-enabled servers at scale requires efficient tooling. The native azcmagent.exe
utility provides local agent management capabilities, but its command syntax and output formats can be cumbersome for daily operations. These free PowerShell modules simplify Arc agent management with consistent command structures and improved user experience.
This guide covers two production-ready PowerShell modules built for enterprise Arc operations:
- AzureArcConnectedAgentManagement - 15 commands for local agent operations (7,000+ downloads)
- AzureArcReOnboardingAssistant - Configuration backup and restoration for re-onboarding scenarios
AzureArcConnectedAgentManagement Module
Built on top of the azcmagent.exe
utility, this module wraps native commands with PowerShell-friendly interfaces. Instead of memorizing complex command syntax like azcmagent show --output json --verbose
, you use intuitive commands like Get-AzureArcNodeAgentInformation
.
Installation
Install-Module -Name AzureArcConnectedAgentManagement
Get-Command -Module AzureArcConnectedAgentManagement
Available Commands
The module provides 15 commands organized by function:
Agent Information & Status
Get-AzureArcNodeAgentInformation
Retrieve agent details with JSON or RAW output
Get-AzureArcNodeAgentInformation -OutPutType JSON Get-AzureArcNodeAgentInformation -OutPutType RAW
Get-AzureArcNodeServiceStatus
Check Azure Hybrid Instance Metadata Service status
Get-AzureArcNodeServiceStatus
Test-AzureArcNodeConnection
Verify current agent connection status
Test-AzureArcNodeConnection
Configuration Management
Get-AzureArcNodeConfiguration
Read agent configuration settings
Get-AzureArcNodeConfiguration -ConfigurationName extensions.allowlist -OutPutType JSON Get-AzureArcNodeConfiguration -ConfigurationName extensions.allowlist -OutPutType RAW
Set-AzureArcNodeConfiguration
Configure agent settings like proxy configuration
Set-AzureArcNodeConfiguration -ConfigurationName proxy.url -ConfigurationValue "http://myproxy:443" -OutPutType JSON
Clear-AzureArcNodeConfiguration
Remove configuration settings
Clear-AzureArcNodeConfiguration -ConfigurationName proxy.bypass -OutPutType JSON
Configuration File Access
Get-AzureArcNodeAgentConfigurationFileContent
Read agent configuration from C:\ProgramData\AzureConnectedMachineAgent\Config\agentconfig.json
Get-AzureArcNodeAgentLocalConfigurationFileContent
Read local configuration from C:\ProgramData\AzureConnectedMachineAgent\Config\localconfig.json
Extension Management
Get-AzureArcNodeAgentInstalledExtensions
List installed extensions from C:\ProgramData\GuestConfig\extension_logs
Get-AzureArcNodeAgentInstalledExtensions | Format-Table -AutoSize -Property ExtensionName, ExtensionState, ExtensionVersion
Connection Operations
Connect-AzureArcNode
Connect machine to Azure Arc with three authentication methods:
- Access Token
- Service Principal
- Device Login
Disconnect-AzureArcNode
Disconnect node from Azure Arc service
Network & Troubleshooting
Test-AzureArcNodeNetworkConnectivity
Verify network connectivity requirements
Test-AzureArcNodeNetworkConnectivity -OutPutType JSON -Location "West Europe"
Save-AzureArcNodeLogs
Export agent logs to desktop for troubleshooting
Service Management
Restart-AzureArcNodeService
Restart Azure Hybrid Instance Metadata Service
Install-AzureArcAgent
Download and install Azure Arc Connected Agent
AzureArcReOnboardingAssistant Module
When Arc extensions become stuck in permanent "Installing" or "Updating" states and normal removal operations fail, re-onboarding becomes necessary. This module automates configuration backup and restoration, preserving tags, data collection rule associations, and endpoint configurations across the re-onboarding process.
The Problem It Solves
Arc agent re-onboarding typically results in loss of:
- Resource tags (including maintenance window schedules)
- Data Collection Rule associations
- Data Collection Endpoint associations
- Agent configuration settings
Manual restoration of these configurations across multiple servers is error-prone and time-consuming.
How It Works
The assistant creates two backup files during operation:
Master Backup File: [SubscriptionId]_[ServerName]_info_master.json
- Created once during first run
- Original untouched backup of server configuration
- Used to revert to initial saved state
Current Backup File: [SubscriptionId]_[ServerName]_info.json
- Created or overwritten each run
- Most recent configuration backup
- Used for tracking changes over time
Restoration Scope
The module restores:
- Tags
- Data Collection Rule Associations
- Data Collection Endpoint Associations
- Notes AgentConfigurationConfigMode setting
Installation
Install-Module -Name AzureArcReOnboardingAssistant
Usage Examples
Full Offboarding and Re-onboarding Process:
Invoke-AzureArcNodeOffboarding -ServerName SERVER1 -ResourceGroupName "MYARCSERVERS" -SubscriptionId "XXXXXXXXX" -OutputLocation "C:\AzureArcServerBackups"
Restore-Only Operation Using Specific Backup:
Invoke-AzureArcNodeOffboarding -ServerName SERVER1 -ResourceGroupName "MYARCSERVERS" -SubscriptionId "XXXXX" -RestoreOnly -RestoreFile "C:\AzureArcServerBackups\XXXXXXXX_SERVER1_info_master.json" -OutputLocation "C:\AzureArcServerBackups"
Additional Resources
These tools complement a comprehensive Arc management strategy:
- Azure Arc for Servers Implementation Guide - Architecture planning and deployment strategies
- Azure Arc Data Sources Reference - Understanding Arc data across Resource Graph, Log Analytics, and Defender XDR
- Azure Arc Solutions Catalog - Done-for-you automation solutions for Arc management
For advanced Arc automation including tag compliance monitoring, MDE integration, and service principal expiry tracking, explore our Azure Arc solutions catalog.