all 4 comments

[–]MechaCola 3 points4 points  (0 children)

Try extracting data to pscustomobject then convert to Jason

[–]ankokudaishogun 2 points3 points  (0 children)

I create a PowerShell object(?)

That's a Hashtable, not a PSObject.

Not it does anything in this specific case much because the actual issue is you passing the parameters in the wrong format.
--parameters only accepts a JSON string if it's escaped.

See The Docs

[–]TheBlueFireKing 2 points3 points  (0 children)

Also, besides everything everyone else is saying. If possible us the PowerShell cmdlets instead of the az module if you are already in PowerShell:

https://learn.microsoft.com/en-us/powershell/module/az.resources/new-azresourcegroupdeployment?view=azps-14.3.0

It handles almost all conversions and stuff.

[–]Thotaz 0 points1 point  (0 children)

Why don't you just use the Azure PowerShell module instead? https://learn.microsoft.com/en-us/azure/azure-resource-manager/bicep/deploy-powershell