Azure Arc Hostname

Handian Sudianto 7,241 Reputation points

When i rename Azure Arc Machine then why after the machine renamed then in azure portal the name still use old name?

0 comments No comments

Sign in to comment

Answer accepted by question author

Siva shunmugam Nadessin 10,895 Reputation points Microsoft External Staff Moderator

Hello Handian Sudianto

Thank you for reaching out to the Microsoft Q&A forum. 

When investigated we see that Azure Arc doesn’t automatically pick up an OS-level hostname change—you’re seeing the “old” name because that’s the resource name you originally gave when you connected the machine. Here’s why and what you can do:

  1. Azure Arc resource names are fixed at onboarding
    • When you run something like az connectedmachine connect --resource-group MyRG --location eastus --resource-name MyArcServer the string MyArcServer becomes the ARM resource name. Renaming the computer in Windows or Linux later doesn’t mutate that Azure resource name.
  2. If you want the portal to show the new name, you have two main options: a. Re-onboard with the new name
    • Disconnect the agent: az connectedmachine disconnect --resource-group MyRG --name OldName
    • Reconnect using your new hostname: az connectedmachine connect --resource-group MyRG --location eastus --resource-name NewHostName b. Or delete the Arc resource and onboard again with your desired name
    • In the portal or via CLI remove the connected machine resource, then run az connectedmachine connect with --resource-name set to the new name.
  3. Going forward, you can pre-empt hostname conflicts or renaming needs by using the --resource-name parameter independently of the OS hostname (for example, append a unique ID). That way you’ll always have control over what shows in the portal.
  4. Reinstall the agent then azure arc showing right name now

Let me know if any further queries - feel free to reach out!

Reference:

  1. Siva shunmugam Nadessin 10,895 Reputation points Microsoft External Staff Moderator

    Handian Sudianto, If the answer was helpful, kindly 👁 User's image
    & up-vote 👁 User's image

     this can be beneficial to other community members.


Sign in to comment

1 additional answer

  1. AI answer

    Azure Arc uses an Azure resource name that is immutable and separate from the operating system hostname.

    When the hostname of the underlying Windows or Linux machine is changed, Azure Arc does not automatically update the existing Arc server resource name in Azure. As with other Azure resources, the Arc-enabled server resource name cannot be renamed in place.

    To have the new hostname reflected in Azure for an Arc-enabled server, the documented approach is:

    1. Remove any VM extensions from the Arc-enabled server resource (so they can be redeployed later).
    2. Disconnect the machine from Azure Arc using azcmagent disconnect, which deletes the Arc server resource in Azure.
    3. Reconnect the machine using azcmagent connect. During reconnect, the agent registers a new Arc-enabled server resource, and by default uses the machine’s current hostname as the resource name (or a custom name via --resource-name).
    4. Redeploy any required VM extensions to the new Arc resource.

    Until this delete-and-recreate process is done, the Azure portal continues to show the old Arc resource name even though the OS hostname has changed.


    References:

    AI-generated content may be incorrect. Read our transparency notes for more information.
Sign in to answer

Your answer