Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ jobs:

# Determine possible parameters depending on file type
if ((Split-Path $moduleTestFilePath -Extension) -eq '.bicep') {
$moduleTemplateContent = az bicep build --file $moduleTestFilePath --stdout | ConvertFrom-Json -AsHashtable
$moduleTemplateContent = bicep build $moduleTestFilePath --stdout | ConvertFrom-Json -AsHashtable
$moduleTemplatePossibleParameters = $moduleTemplateContent.parameters.Keys
} else {
$moduleTemplatePossibleParameters = ((Get-Content $moduleTestFilePath -Raw) | ConvertFrom-Json -AsHashtable).parameters.keys
Expand Down Expand Up @@ -259,7 +259,7 @@ jobs:

# Determine possible parameters depending on file type
if ((Split-Path $moduleTestFilePath -Extension) -eq '.bicep') {
$moduleTemplateContent = az bicep build --file $moduleTestFilePath --stdout | ConvertFrom-Json -AsHashtable
$moduleTemplateContent = bicep build $moduleTestFilePath --stdout | ConvertFrom-Json -AsHashtable
$moduleTemplatePossibleParameters = $moduleTemplateContent.parameters.Keys
} else {
$moduleTemplatePossibleParameters = ((Get-Content $moduleTestFilePath -Raw) | ConvertFrom-Json -AsHashtable).parameters.keys
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ runs:

# Determine possible parameters depending on file type
if ((Split-Path $moduleTestFilePath -Extension) -eq '.bicep') {
$moduleTemplateContent = az bicep build --file $moduleTestFilePath --stdout | ConvertFrom-Json -AsHashtable
$moduleTemplateContent = bicep build $moduleTestFilePath --stdout | ConvertFrom-Json -AsHashtable
$moduleTemplatePossibleParameters = $moduleTemplateContent.parameters.Keys
} else {
$moduleTemplatePossibleParameters = ((Get-Content $moduleTestFilePath -Raw) | ConvertFrom-Json -AsHashtable).parameters.keys
Expand Down Expand Up @@ -239,7 +239,7 @@ runs:

# Determine possible parameters depending on file type
if ((Split-Path $moduleTestFilePath -Extension) -eq '.bicep') {
$moduleTemplateContent = az bicep build --file $moduleTestFilePath --stdout | ConvertFrom-Json -AsHashtable
$moduleTemplateContent = bicep build $moduleTestFilePath --stdout | ConvertFrom-Json -AsHashtable
$moduleTemplatePossibleParameters = $moduleTemplateContent.parameters.Keys
} else {
$moduleTemplatePossibleParameters = ((Get-Content $moduleTestFilePath -Raw) | ConvertFrom-Json -AsHashtable).parameters.keys
Expand Down
10 changes: 5 additions & 5 deletions utilities/pipelines/staticValidation/module.tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ $script:moduleFolderPaths = $moduleFolderPaths
$script:convertedTemplates = @{}

# Shared exception messages
$script:bicepTemplateCompilationFailedException = "Unable to compile the deploy.bicep template's content. This can happen if there is an error in the template. Please check if you can run the command ``az bicep build --file {0} --stdout | ConvertFrom-Json -AsHashtable``." # -f $templateFilePath
$script:bicepTemplateCompilationFailedException = "Unable to compile the deploy.bicep template's content. This can happen if there is an error in the template. Please check if you can run the command ``bicep build {0} --stdout | ConvertFrom-Json -AsHashtable``." # -f $templateFilePath
$script:jsonTemplateLoadFailedException = "Unable to load the deploy.json template's content. This can happen if there is an error in the template. Please check if you can run the command `Get-Content {0} -Raw | ConvertFrom-Json -AsHashtable`." # -f $templateFilePath
$script:templateNotFoundException = 'No template file found in folder [{0}]' # -f $moduleFolderPath

Expand Down Expand Up @@ -170,7 +170,7 @@ Describe 'Readme tests' -Tag Readme {
if (-not ($convertedTemplates.Keys -contains $moduleFolderPathKey)) {
if (Test-Path (Join-Path $moduleFolderPath 'deploy.bicep')) {
$templateFilePath = Join-Path $moduleFolderPath 'deploy.bicep'
$templateContent = az bicep build --file $templateFilePath --stdout | ConvertFrom-Json -AsHashtable
$templateContent = bicep build $templateFilePath --stdout | ConvertFrom-Json -AsHashtable

if (-not $templateContent) {
throw ($bicepTemplateCompilationFailedException -f $templateFilePath)
Expand Down Expand Up @@ -684,7 +684,7 @@ Describe 'Deployment template tests' -Tag Template {
if (-not ($convertedTemplates.Keys -contains $moduleFolderPathKey)) {
if (Test-Path (Join-Path $moduleFolderPath 'deploy.bicep')) {
$templateFilePath = Join-Path $moduleFolderPath 'deploy.bicep'
$templateContent = az bicep build --file $templateFilePath --stdout | ConvertFrom-Json -AsHashtable
$templateContent = bicep build $templateFilePath --stdout | ConvertFrom-Json -AsHashtable

if (-not $templateContent) {
throw ($bicepTemplateCompilationFailedException -f $templateFilePath)
Expand Down Expand Up @@ -732,7 +732,7 @@ Describe 'Deployment template tests' -Tag Template {

$deploymentTestFile_AllParameterNames = $rawContentHashtable.parameters.Keys | Sort-Object
} else {
$deploymentFileContent = az bicep build --file $moduleTestFilePath --stdout | ConvertFrom-Json -AsHashtable
$deploymentFileContent = bicep build $moduleTestFilePath --stdout | ConvertFrom-Json -AsHashtable
$deploymentTestFile_AllParameterNames = $deploymentFileContent.resources[-1].properties.parameters.Keys | Sort-Object # The last resource should be the test
}
$testFileTestCases += @{
Expand Down Expand Up @@ -1218,7 +1218,7 @@ Describe "API version tests [All apiVersions in the template should be 'recent']
if (-not ($convertedTemplates.Keys -contains $moduleFolderPathKey)) {
if (Test-Path (Join-Path $moduleFolderPath 'deploy.bicep')) {
$templateFilePath = Join-Path $moduleFolderPath 'deploy.bicep'
$templateContent = az bicep build --file $templateFilePath --stdout | ConvertFrom-Json -AsHashtable
$templateContent = bicep build $templateFilePath --stdout | ConvertFrom-Json -AsHashtable

if (-not $templateContent) {
throw ($bicepTemplateCompilationFailedException -f $templateFilePath)
Expand Down
29 changes: 23 additions & 6 deletions utilities/src/apiSpecsList.json
Original file line number Diff line number Diff line change
Expand Up @@ -2841,7 +2841,8 @@
"2021-08-01-preview",
"2021-09-01",
"2021-12-01-preview",
"2022-02-01-preview"
"2022-02-01-preview",
"2022-12-01"
],
"registries/agentPools": [
"2019-06-01-preview"
Expand Down Expand Up @@ -2890,7 +2891,8 @@
"2021-08-01-preview",
"2021-09-01",
"2021-12-01-preview",
"2022-02-01-preview"
"2022-02-01-preview",
"2022-12-01"
],
"registries/replications": [
"2017-06-01-preview",
Expand All @@ -2902,15 +2904,17 @@
"2021-08-01-preview",
"2021-09-01",
"2021-12-01-preview",
"2022-02-01-preview"
"2022-02-01-preview",
"2022-12-01"
],
"registries/scopeMaps": [
"2019-05-01-preview",
"2020-11-01-preview",
"2021-06-01-preview",
"2021-08-01-preview",
"2021-12-01-preview",
"2022-02-01-preview"
"2022-02-01-preview",
"2022-12-01"
],
"registries/taskRuns": [
"2019-06-01-preview"
Expand All @@ -2926,7 +2930,8 @@
"2021-06-01-preview",
"2021-08-01-preview",
"2021-12-01-preview",
"2022-02-01-preview"
"2022-02-01-preview",
"2022-12-01"
],
"registries/webhooks": [
"2017-06-01-preview",
Expand All @@ -2938,7 +2943,8 @@
"2021-08-01-preview",
"2021-09-01",
"2021-12-01-preview",
"2022-02-01-preview"
"2022-02-01-preview",
"2022-12-01"
]
},
"Microsoft.ContainerRegistry.Admin": {
Expand Down Expand Up @@ -14201,6 +14207,17 @@
"2019-04-01"
]
},
"Microsoft.VoiceServices": {
"communicationsGateways": [
"2022-12-01-preview"
],
"communicationsGateways/contacts": [
"2022-12-01-preview"
],
"communicationsGateways/testLines": [
"2022-12-01-preview"
]
},
"Microsoft.Web": {
"certificates": [
"2015-08-01",
Expand Down
4 changes: 2 additions & 2 deletions utilities/tools/ConvertTo-ARMTemplate.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -100,12 +100,12 @@ function ConvertTo-ARMTemplate {
$expectedJSONFilePath = Join-Path (Split-Path $_ -Parent) ('{0}.json' -f (Split-Path $_ -LeafBase))
if (-not (Test-Path $expectedJSONFilePath)) {
Write-Verbose "Building template [$_]"
az bicep build --file $_
bicep build $_
} else {
Write-Verbose "Template [$expectedJSONFilePath] already existing"
}
}
if ($PSCmdlet.ShouldProcess(('Bicep [{0}] Templates' -f ($BicepFilesToConvert.count)), 'az bicep build')) {
if ($PSCmdlet.ShouldProcess(('Bicep [{0}] Templates' -f ($BicepFilesToConvert.count)), 'bicep build')) {
if ($RunSynchronous) {
$BicepFilesToConvert | ForEach-Object $buildScriptBlock
} else {
Expand Down
2 changes: 1 addition & 1 deletion utilities/tools/Set-ModuleReadMe.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -1464,7 +1464,7 @@ function Set-ModuleReadMe {

if (-not $TemplateFileContent) {
if ((Split-Path -Path $TemplateFilePath -Extension) -eq '.bicep') {
$templateFileContent = az bicep build --file $TemplateFilePath --stdout | ConvertFrom-Json -AsHashtable
$templateFileContent = bicep build $TemplateFilePath --stdout | ConvertFrom-Json -AsHashtable
} else {
$templateFileContent = ConvertFrom-Json (Get-Content $TemplateFilePath -Encoding 'utf8' -Raw) -ErrorAction Stop -AsHashtable
}
Expand Down