Skip to content

Commit 925b2c3

Browse files
authored
Merge pull request #967 from Azure/feature/apy/Updates-To-Sync-ALZFromLibrary
updated default stucture and assignments to be jsonc
2 parents ad3aa8a + 73fb77d commit 925b2c3

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

Scripts/CloudAdoptionFramework/New-ALZPolicyDefaultStructure.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ foreach ($parameter in $policyDefaultFile.defaults) {
8686
$jsonOutput.defaultParameterValues.Add($parameter.default_name, $obj)
8787
}
8888

89-
Out-File "$DefinitionsRootFolder\$($Type.ToLower()).policy_default_structure.json" -InputObject ($jsonOutput | ConvertTo-Json -Depth 10) -Encoding utf8 -Force
89+
Out-File "$DefinitionsRootFolder\$($Type.ToLower()).policy_default_structure.jsonc" -InputObject ($jsonOutput | ConvertTo-Json -Depth 10) -Encoding utf8 -Force
9090

9191

9292
if ($LibraryPath -eq "./temp") {

Scripts/CloudAdoptionFramework/Sync-ALZPolicyFromLibrary.ps1

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ foreach ($file in Get-ChildItem -Path "$LibraryPath\platform\$($Type.ToLower())\
107107
# Create assignment objects
108108

109109
try {
110-
$structureFile = Get-Content $DefinitionsRootFolder\$Type.policy_default_structure.json -ErrorAction Stop | ConvertFrom-Json
110+
$structureFile = Get-Content $DefinitionsRootFolder\$Type.policy_default_structure.jsonc -ErrorAction Stop | ConvertFrom-Json
111111
switch ($structureFile.enforcementMode) {
112112
"Default" { $enforcementModeText = "must" }
113113
"DoNotEnforce" { $enforcementModeText = "should" }
@@ -220,9 +220,9 @@ foreach ($file in Get-ChildItem -Path "$LibraryPath\platform\$($Type.ToLower())\
220220

221221

222222
$category = $structureFile.managementGroupNameMappings.$scopeTrim.management_group_function
223-
([PSCustomObject]$baseTemplate | Select-Object -Property "`$schema", nodeName, assignment, definitionEntry, definitionVersion, enforcementMode, parameters, nonComplianceMessages, scope | ConvertTo-Json -Depth 50) -replace "\[\[", "[" | New-Item -Path $DefinitionsRootFolder\policyAssignments\$Type\$category -ItemType File -Name "$($fileContent.name).json" -Force -ErrorAction SilentlyContinue
223+
([PSCustomObject]$baseTemplate | Select-Object -Property "`$schema", nodeName, assignment, definitionEntry, definitionVersion, enforcementMode, parameters, nonComplianceMessages, scope | ConvertTo-Json -Depth 50) -replace "\[\[", "[" | New-Item -Path $DefinitionsRootFolder\policyAssignments\$Type\$category -ItemType File -Name "$($fileContent.name).jsonc" -Force -ErrorAction SilentlyContinue
224224
if ($fileContent.name -eq "Deploy-Private-DNS-Zones") {
225-
(Get-Content $DefinitionsRootFolder\policyAssignments\$Type\$category\$($fileContent.name).json) -replace "\.ne\.", ".$dnsZoneRegion." | Set-Content $DefinitionsRootFolder\policyAssignments\$Type\$category\$($fileContent.name).json
225+
(Get-Content $DefinitionsRootFolder\policyAssignments\$Type\$category\$($fileContent.name).jsonc) -replace "\.ne\.", ".$dnsZoneRegion." | Set-Content $DefinitionsRootFolder\policyAssignments\$Type\$category\$($fileContent.name).jsonc
226226
}
227227
}
228228

0 commit comments

Comments
 (0)