Azure Automation Hybrid Woker permission automatically removed

Carlo Berchtold 20 Reputation points
2025-08-08T07:54:19.86+00:00

We are experiencing a recurring issue with two installed instances of the Azure Automation Hybrid Worker extension. For several months, both extensions have exhibited the same behavior: approximately twice per month, the custom credential permissions are inexplicably removed from the following paths:

  • C:\ProgramData\AzureConnectedMachineAgent\Tokens — Read access
  • C:\Packages\Plugins\Microsoft.Azure.Automation.HybridWorker.HybridWorkerForWindows — Read and Execute access

The issue results in jobs being suspended.

Initially, we suspected this might be triggered by Windows Updates or extension upgrades, but after some checks, these events do not correlate with the permission resets. The root cause remains unclear, and the behavior appears to be non-deterministic and unrelated to any scheduled system or extension-level changes.

Azure Automation
Azure Automation
An Azure service that is used to automate, configure, and install updates across hybrid environments.
{count} votes

Answer accepted by question author
  1. Mark 80 Reputation points
    2025-09-25T18:25:10.61+00:00

    I was able to get past this using New-AzConnectedMachineRunCommand on Azure Arc connected machines. I just placed a script on the machines(could probably use a shared location if needed) that restored the rights before trying to connect to the hybrid worker. It can take up to 5 minutes to run on a machine, but worth it for me.

    New-AzConnectedMachineRunCommand -ResourceGroupName "Resourcegroup" -MachineName "machinename" -Location "eastus" -RunCommandName "TestFile" -SourceScript "Invoke-Command -FilePath C:\Scripts\restorerights.ps1 -ComputerName machinename" -SubscriptionId "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"

    1 person found this answer helpful.

0 additional answers

Sort by: Most helpful

Your answer

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