Az PowerShell and bicepparam string issue #11984
-
Hi there, I am using Az PowerShell v10.4.1 and trying to use the cmdlets However, when i run those cmdlets i get the following error (i have amended the parameter name):
If i run the equivalent with the CLI i do not get this issue and it reads both the bicep file and bicepparam file OK. Here is the pertinent code: main.bicep
main.bicepparam
Please also note, if i remove the params from the parameter file and set the value in the main bicep file - it also works. Seems like there is an issue with Az Powershell and the bicepparams file? Examples of what i am running: DOESNT WORK:
WORKS:
|
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 2 replies
-
Potential related issues: |
Beta Was this translation helpful? Give feedback.
-
As per #11983 (comment) I moved to Az Powershell version 10.3.0 and that fixed the issue for me. |
Beta Was this translation helpful? Give feedback.
-
Still got this issue here. Here my system: PS> Get-InstalledModule -Name Az
Version Name Repository Description
------- ---- ---------- -----------
10.4.1 Az PSGallery
PS> Get-InstalledModule -Name Az.Resources
Version Name Repository Description
------- ---- ---------- -----------
6.11.1 Az.Resources PSGallery
PS> bicep -v
Bicep CLI version 0.21.1 (d4acbd2a9f) main.bicep: targetScope = 'subscription'
@allowed([
'West Europe'
'North Europe'
'Global'
])
@description('The location where to create the resources in.')
param location string = 'West Europe' main.bicepparam: using './main.bicep'
param location = 'West Europe' Test-AzDeployment `
-Name 'deploy' `
-Location 'westeurope' `
-TemplateFile .\main.bicep `
-TemplateParameterFile .\main.bicepparam gives InvalidTemplate - Deployment template validation failed: 'The provided value for the template parameter 'location' is not valid. The value '{
"value": "West Europe"
}' is not part of the allowed value(s): 'West Europe,North Europe,Global'.'. |
Beta Was this translation helpful? Give feedback.
-
I have had the same issue with version 10.4.1. I have installed the latest version at the current time of this post v. 11.1.0 from (https://www.powershellgallery.com/packages/Az/11.1.0) and it helped resolve the issue.
|
Beta Was this translation helpful? Give feedback.
I have had the same issue with version 10.4.1.
I have installed the latest version at the current time of this post v. 11.1.0 from (https://www.powershellgallery.com/packages/Az/11.1.0) and it helped resolve the issue.