An Azure service that is used to automate, configure, and install updates across hybrid environments.
This behavior is expected given how parameters are serialized and deserialized when starting runbooks, especially across Hybrid Runbook Workers.
Start-AzAutomationRunbook sends parameter values through the Azure Automation web service. Parameters are serialized (often via JSON or similar mechanisms) and then deserialized on the worker. For string values that contain backslashes (like UNC paths), this serialization layer escapes backslashes as \\ during transport.
In Azure sandboxes, the runtime is correctly unescaping the value so the runbook parameter ends up as \\server\share (PowerShell literal for \\server\share), which is what is expected for a UNC path.
On Hybrid Runbook Workers, the same parameter is not being unescaped in the same way, so the runbook receives the raw escaped representation (\\\\server\\share), which is why the input view shows doubled backslashes. This difference is due to how Hybrid Runbook Workers handle the parameter payload, not to how the parameter is defined in the runbook.
To work around this on Hybrid Runbook Workers, normalize the parameter value at the start of the child runbook, for example by replacing double backslashes with single backslashes:
param(
[Parameter(Mandatory = $false)]
[string]$param
)
# Normalize UNC path if it arrived double-escaped
$param = $param -replace '\\\\', '\\'
This keeps the calling pattern with Start-AzAutomationRunbook unchanged and ensures the child runbook always works with a correctly formatted UNC path, regardless of whether it runs in Azure or on a Hybrid Runbook Worker.
References: