Arc Connected VMs not being return on Get-AZConnectedMachine or 'az connectedmachine list'

Andy DeAngelis 21 Reputation points
2022-10-24T17:12:37.343+00:00

Good day, all.

I'm currently setting up a PoC environment for my organization to utilize Azure Arc to manage on-prem VMware virtual machines. I've set everything up per the MS whitepapers, and all is well. I can see my vcenter and Azure enabled resources all within the portal. For reference, I did not install any agents on these on-prem VMs manually. I created the Azure Arc virtual appliance using the generated script, and once deployed, selected which VMs I wanted to enable via the Azure portal (which then installed the agent for me). I've also set up a log analytics workspace, enabled change tracking, built a few test runbooks in Azure Automation etc. All is working fine, with one exception.

I am unable to retrieve any of the information for my connected VMs via the command line. I've tried both the Azure CLI and PowerShell, with neither providing so much as an error.

For reference, when I run either 'az connectedmachine listazure cliazure cli' or 'Get-AzConnectedMachine,' I receive an empty array. However, if I run the 'Get-AzResource' command, I receive everything back that I expect.

PS /home/andy> Get-AzResource | ?{$_.ResourceType -eq "Microsoft.ConnectedVMwarevSphere/virtualmachines"} | Select Name,ResourceGroupName | fl  
  
Name              : ubuntu-22-04-01  
ResourceGroupName : andy-home-lin  
  
Name              : arc-2016-01  
ResourceGroupName : andy-home-win  
  
Name              : arc-2019-01  
ResourceGroupName : andy-home-win  
  
Name              : arc-2022-01  
ResourceGroupName : andy-home-win  

The only thing I can think of is the ResourceType is different between a manually installed machine vs a machine imported from vCenter in Azure Arc.

Has anyone tried adding your vCenter to Azure arc, azure clienabling specific VMs to be Azure enabled and then tried to access those resources via PowerShell/Azure CLI? I've been banging my head against the wall on this for about a week to no avail, so I'm hoping someone has run into this or can point me in the right direction.

Azure Arc
Azure Arc
A Microsoft cloud service that enables deployment of Azure services across hybrid and multicloud environments.
525 questions
0 comments No comments
{count} votes

Accepted answer
  1. Ryan Hill 30,281 Reputation points Microsoft Employee Moderator
    2022-10-25T17:53:52.747+00:00

    VMs created or imported from the Arc VMware experience will have the Microsoft.ConnectedVMwarevSphere/virtualMachines resource type, which is a superset of Microsoft.HybridCompute/machines. This is more of an implementation detail and I didn’t find any docs referring to it but is more than likely what you’re running into.

    0 comments No comments

1 additional answer

Sort by: Most helpful
  1. Andy DeAngelis 21 Reputation points
    2022-10-26T19:38:53.04+00:00

    Thanks @Ryan Hill . That looks to be exactly the case. I removed all my items from Arc, including vCenter, then simply deployed the agent to the guest systems via SCCM, and now all show up in PoSH.

    Thanks for the assist!

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.