Golden Image with Azure ARC agent preinstalled

Pettigrove, Matthew 31 Reputation points
2022-07-26T01:07:58.857+00:00

Have a similar question answered in https://learn.microsoft.com/answers/questions/865850/building-vm-template-or-golden-image-with-azure-ar.html

Have the Arc agent installed in the image, however need to run the connect script at system boot as each VM created from the template starts for the first time, not when a user logs in.

Created a scheduled task to run at boot, however receiving an error, this is output from the Powershell script invoked by the scheduled task.

time="2022-07-26T09:53:47+10:00" level=info msg="Exit Code: AZCM0070: Unable To Obtain Local Config"
time="2022-07-26T09:53:47+10:00" level=fatal msg="open \\.\PIPE\himds: The system cannot find the file specified."

Script is

Run connect command

& "$env:ProgramW6432\AzureConnectedMachineAgent\azcmagent.exe" connect --service-principal-id "$servicePrincipalClientId" --service-principal-secret "$servicePrincipalSecret" --resource-group "$resource_group" --tenant-id "$tenant_id" --location "$location" --subscription-id "$sub" --cloud "AzureCloud" --correlation-id "$corrID" | out-file C:\output.txt -Append

Have tried running the scheduled task as SYSTEM and also the local administrator, but the same issue.

If I manually run the task, it completes correctly and the VM is registered.

Any ideas?

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

Accepted answer
  1. tbgangav-MSFT 10,421 Reputation points
    2022-07-30T04:09:19.457+00:00

    Hi @Pettigrove, Matthew ,

    I have worked with Azure Arc product team on this. The cause of the exit code AZCM0070 is "Unable to obtain local config" and the remediation is "the Hybrid Instance Metadata service (HIMDS) might not be running. Check the status of your HIMDS service (for Windows) or the HIMDS daemon (for Linux)". Same information was added in this troubleshooting document. Let me know if it doesn't help.

    226285-image.png

    2 people found this answer helpful.

0 additional answers

Sort by: Most helpful