To fully remove a computer from Azure Arc-enabled servers, follow the official steps in the Uninstall the Azure Connected Machine agent guide to clear extensions, disconnect the agent, and remove the local software.
1. Remove VM Extensions
Open the Azure portal.
Go to Azure Arc and select Machines.
Click your target server, go to Extensions, select any installed extensions, and click Uninstall.
2. Disconnect the Agent from the Server
Open an administrative command prompt on the physical or virtual machine.
Run the following command to disconnect the agent and delete the Azure resource representation:
bash
azcmagent disconnectSign in with your Azure account when prompted.
(Note: If the Azure resource was already deleted manually in the portal, runazcmagent disconnect --force-local-onlyinstead).
3. Uninstall the Agent Software
Windows: Open Control Panel > Programs and Features, select Azure Connected Machine Agent, and click Uninstall.
Linux: Use your package manager (e.g.,
sudo apt purge azcmagentorsudo yum remove azcmagent).Manually delete leftover configuration folders if needed, such as
C:\Program Files\AzureConnectedMachineAgenton Windows.