Hi managed to fix it by using the -Name switch for New-AzManagementGroupDeployment. Had to make up a name that is unique.
Thought if you don't specify a name, it auto generates one using a time stamp but, in this case, did not work.
Bicep deployment failes with error "New-AzManagementGroupDeployment : 9:35:38 am - Error: Code=; Message='deploymentName' does not match expected pattern '^[-\w\._\(\)]+$'"
Peter Kutter
11
Reputation points
Hi,
trying to create a role assignment at the management level using Bicep and PowerShell to deploy.
When I run with what-if switch it succeeds with no errors. However if I remove the switch it fails with following error.
--------------
New-AzManagementGroupDeployment : 9:35:38 am - Error: Code=; Message='deploymentName' does not match expected pattern '^[-\w._()]+$'.
------------------
I haven't specified a name. Even tried using the -Name switch but same result.
Not sure what else I can look at.
thanks,
Peter
1 answer
Sort by: Most helpful
-
Peter Kutter 11 Reputation points
2022-11-01T22:15:47.697+00:00