A Microsoft cloud service that enables deployment of Azure services across hybrid and multicloud environments.
Hi Daniel; based on the behavior you described, this does look like an unintended error-handling issue in the script; if the purpose of the first partnerconfig get serialNumber --partner hcrp call is to check whether the value already exists, a missing value should be treated as an expected condition and the script should continue with the initialization of serialNumber and machineprofile
The fact that the scheduled task remains in the Running state also suggests that the exception is not being handled correctly or that a child process is left open after the failure.
Automatic upgrades are currently still in preview, so I would definitely open a support case or report it through the Azure Arc feedback channel and include the script version, the complete PowerShell error, the scheduled task history and the Connected Machine Agent logs; Microsoft documents the automatic upgrade feature as preview and recommends checking the agent logs when troubleshooting agent failures.
As a temporary workaround, wrapping the initial partnerconfig get call in a dedicated try/catch, or checking its exit code without terminating the script, should allow the registration logic to continue when the value is not yet configured; I would still avoid permanently modifying the Microsoft script without keeping a copy, since it may be replaced during the next agent update.