az vm user update fails to reset Windows VM password when password contains ')' character
- Dominant language
- Python
- Stars
- 4.6k
- Forks
- 3.5k
- Avg merge
- 3d 2h
- Merged PRs (30d)
- 60
Description
### Describe the bug
`az vm user update` fails when setting a password containing a closing parenthesis `)` on a Windows VM.
The same command succeeds immediately when the `)` character is removed from the password.
The issue occurs when running Azure CLI from PowerShell Core on Windows.
The error returned is:
was unexpected at this time.
This appears to be a command parsing/escaping issue somewhere in the Windows VM password reset workflow, as `)` is a valid Windows password character and should not cause the operation to fail.
### Related command
az vm user update `
--resource-group myrg `
--name myvm `
--username adm_myvm `
--password 'Test)123'
### Errors
`123 was unexpected at this time.`
### Issue script & Debug output
```
C:\Users\myuser> az vm user update --resource-group myrg --name myvm --username adm_myvm --password "Test)123" --debug
123 was unexpected at this time.
C:\Users\myuser> "C:\Program Files\Microsoft SDKs\Azure\CLI2\wbin\\..\python.exe" -IBm azure.cli vm user update --resource-group myrg --name myvm --username adm_myvm --password Test)123 --debug
```
Azure is not even contacted, the command fails immediately.
### Expected behavior
The password should be updated successfully regardless of the presence of `)` in the password.
### Environment Summary
OS: Windows 11 25H2
Shell: PowerShell 7.6.5
Azure CLI Version: 2.89.0
Output of `az version`:
{
"azure-cli": "2.89.0",
"azure-cli-core": "2.89.0",
"azure-cli-telemetry": "1.1.0",
"extensions": {
"application-insights": "1.2.3",
"azure-devops": "1.0.4",
"bastion": "1.4.2",
"communication": "1.14.0",
"hack": "0.4.3",
"interactive": "1.0.0b1",
"portal": "1.0.0b2",
"resource-graph": "2.1.1",
"ssh": "2.0.6",
"terraform": "1.0.0b1"
}
}
Guest OS: Windows Server 2025
### Additional context
- The issue is reproducible.
- The problem occurs even when the password is stored in a PowerShell variable and passed via `--password $password`.
- The problem is not caused by PowerShell parsing.
- The command succeeds as soon as the `)` character is removed from the password.
- This suggests an escaping/parsing issue somewhere in the password reset implementation path used by `az vm user update`.
Contributor guide
Assessment
This issue has not been assessed yet.