Skip to content

Commit cdafd15

Browse files
authored
Update Template Api Versions (#872)
* UpdateModule * Update-Command * UpdateApiVersions * UpdateApiVersion
1 parent 02c19f0 commit cdafd15

File tree

6 files changed

+26
-26
lines changed

6 files changed

+26
-26
lines changed

scripts/New-AzOpsTestsDeploymentHelper.ps1

+2-2
Original file line numberDiff line numberDiff line change
@@ -95,10 +95,10 @@
9595
try {
9696
Write-PSFMessage -Level Verbose -Message "Deployment of $script:resourceType starting at $Scope scope."
9797
if ($script:templateParametersFile) {
98-
$script:functionalTestDeploy = New-AzSubscriptionDeployment -Name ($script:resourceType + 'testdeploy') -TemplateFile $script:templateFile -TemplateParameterFile $script:templateParametersFile -Location $Location -Confirm:$false
98+
$script:functionalTestDeploy = New-AzDeployment -Name ($script:resourceType + 'testdeploy') -TemplateFile $script:templateFile -TemplateParameterFile $script:templateParametersFile -Location $Location -Confirm:$false
9999
}
100100
else {
101-
$script:functionalTestDeploy = New-AzSubscriptionDeployment -Name ($script:resourceType + 'testdeploy') -TemplateFile $script:templateFile -Location $Location -Confirm:$false
101+
$script:functionalTestDeploy = New-AzDeployment -Name ($script:resourceType + 'testdeploy') -TemplateFile $script:templateFile -Location $Location -Confirm:$false
102102
}
103103
$script:return = [PSCustomObject]@{
104104
functionalTestDeploy = $script:functionalTestDeploy

src/AzOps.psd1

+3-3
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
#
44
# Generated by: Customer Architecture Team (CAT)
55
#
6-
# Generated on: 03/21/2024
6+
# Generated on: 4/3/2024
77
#
88

99
@{
@@ -52,10 +52,10 @@ PowerShellVersion = '7.2'
5252

5353
# Modules that must be imported into the global environment prior to importing this module
5454
RequiredModules = @(@{ModuleName = 'PSFramework'; RequiredVersion = '1.10.318'; },
55-
@{ModuleName = 'Az.Accounts'; RequiredVersion = '2.16.0'; },
55+
@{ModuleName = 'Az.Accounts'; RequiredVersion = '2.17.0'; },
5656
@{ModuleName = 'Az.Billing'; RequiredVersion = '2.0.3'; },
5757
@{ModuleName = 'Az.ResourceGraph'; RequiredVersion = '0.13.0'; },
58-
@{ModuleName = 'Az.Resources'; RequiredVersion = '6.16.0'; })
58+
@{ModuleName = 'Az.Resources'; RequiredVersion = '6.16.1'; })
5959

6060
# Assemblies that must be loaded prior to importing this module
6161
# RequiredAssemblies = @()

src/data/template/template.json

+18-18
Original file line numberDiff line numberDiff line change
@@ -86,21 +86,21 @@
8686
json('null')
8787
)]",
8888
"apiVersionLookup": {
89-
"Microsoft.Resources/resourceGroups":"2020-06-01",
90-
"Microsoft.Authorization/policyAssignments": "2020-03-01",
91-
"Microsoft.Authorization/policyDefinitions": "2020-03-01",
92-
"Microsoft.Authorization/PolicySetDefinitions": "2020-03-01",
93-
"Microsoft.Authorization/roleDefinitions": "2018-01-01-preview",
94-
"Microsoft.Authorization/roleAssignments": "2020-04-01-preview",
95-
"Microsoft.PolicyInsights/remediations": "2019-07-01",
96-
"Microsoft.ContainerService/ManagedClusters": "2020-09-01",
97-
"Microsoft.KeyVault/vaults":"2019-09-01",
89+
"Microsoft.Resources/resourceGroups":"2023-07-01",
90+
"Microsoft.Authorization/policyAssignments": "2023-04-01",
91+
"Microsoft.Authorization/policyDefinitions": "2023-04-01",
92+
"Microsoft.Authorization/policySetDefinitions": "2023-04-01",
93+
"Microsoft.Authorization/roleDefinitions": "2022-04-01",
94+
"Microsoft.Authorization/roleAssignments": "2022-04-01",
95+
"Microsoft.PolicyInsights/remediations": "2021-10-01",
96+
"Microsoft.ContainerService/managedClusters": "2024-02-01",
97+
"Microsoft.KeyVault/vaults":"2023-07-01",
9898
"Microsoft.Network/virtualWans": "2020-05-01",
9999
"Microsoft.Network/virtualHubs": "2020-05-01",
100100
"Microsoft.Network/virtualNetworks": "2020-06-01",
101101
"Microsoft.Network/azureFirewalls": "2020-06-01",
102-
"/providers/Microsoft.Management/managementGroups": "2020-05-01",
103-
"/subscriptions": "2020-05-01",
102+
"/providers/Microsoft.Management/managementGroups": "2023-04-01",
103+
"/subscriptions": "2021-10-01",
104104
"na": "9999-99-99",
105105
"": "0000-00-00"
106106
},
@@ -316,7 +316,7 @@
316316
"scope": "[concat('Microsoft.Management/managementGroups/',parameters('input').name)]",
317317
*/
318318
"type": "Microsoft.Resources/deployments",
319-
"apiVersion": "2019-10-01",
319+
"apiVersion": "2023-07-01",
320320
"location": "[deployment().location]",
321321
"name": "[if(
322322
and(contains(parameters('input'), 'children'),not(empty(parameters('input').children))),
@@ -411,7 +411,7 @@
411411
},
412412
"scope": "[concat('Microsoft.Management/managementGroups/',parameters('input').name)]",
413413
"type": "Microsoft.Resources/deployments",
414-
"apiVersion": "2020-06-01",
414+
"apiVersion": "2023-07-01",
415415
"location": "[deployment().location]",
416416
"name": "[if(
417417
and(
@@ -509,7 +509,7 @@
509509
},
510510
"scope": "[concat('Microsoft.Management/managementGroups/',parameters('input').name)]",
511511
"type": "Microsoft.Resources/deployments",
512-
"apiVersion": "2020-06-01",
512+
"apiVersion": "2023-07-01",
513513
"location": "[deployment().location]",
514514
"name": "[if(
515515
and(
@@ -608,7 +608,7 @@
608608
},
609609
"scope": "[concat('Microsoft.Management/managementGroups/',parameters('input').name)]",
610610
"type": "Microsoft.Resources/deployments",
611-
"apiVersion": "2020-06-01",
611+
"apiVersion": "2023-07-01",
612612
"location": "[deployment().location]",
613613
"name": "[if(
614614
and(
@@ -705,7 +705,7 @@
705705
},
706706
"scope": "[concat('Microsoft.Management/managementGroups/',parameters('input').name)]",
707707
"type": "Microsoft.Resources/deployments",
708-
"apiVersion": "2020-06-01",
708+
"apiVersion": "2023-07-01",
709709
"location": "[deployment().location]",
710710
"name": "[if(
711711
and(
@@ -802,7 +802,7 @@
802802
},
803803
"scope": "[concat('Microsoft.Management/managementGroups/',parameters('input').name)]",
804804
"type": "Microsoft.Resources/deployments",
805-
"apiVersion": "2020-06-01",
805+
"apiVersion": "2023-07-01",
806806
"location": "[deployment().location]",
807807
"name": "[if(
808808
and(
@@ -885,4 +885,4 @@
885885
"value": "[uri(parameters('_artifactsLocation'), concat('template.json', parameters('_artifactsLocationSasToken')))]"
886886
}
887887
}
888-
}
888+
}

src/internal/functions/New-AzOpsDeployment.ps1

+1-1
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@
130130
Write-AzOpsMessage -LogLevel Verbose -LogString 'New-AzOpsDeployment.Subscription.Processing' -LogStringValues $defaultDeploymentRegion, $scopeObject -Target $scopeObject
131131
Set-AzOpsContext -ScopeObject $scopeObject
132132
$whatIfCommand = 'Get-AzSubscriptionDeploymentWhatIfResult'
133-
$deploymentCommand = 'New-AzSubscriptionDeployment'
133+
$deploymentCommand = 'New-AzDeployment'
134134
}
135135
# Management Groups
136136
elseif ($scopeObject.managementGroup -and (-not ($scopeObject.StatePath).StartsWith('azopsscope-assume-new-resource_'))) {

src/tests/integration/Repository.Tests.ps1

+1-1
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ Describe "Repository" {
6666
Location = "northeurope"
6767
}
6868
try {
69-
New-AzSubscriptionDeployment -Name 'AzOps-Tests-rbacdep' -Location northeurope -TemplateFile "$($global:testRoot)/templates/rbactest.bicep" -TemplateParameterFile "$($global:testRoot)/templates/rbactest.parameters.json"
69+
New-AzDeployment -Name 'AzOps-Tests-rbacdep' -Location northeurope -TemplateFile "$($global:testRoot)/templates/rbactest.bicep" -TemplateParameterFile "$($global:testRoot)/templates/rbactest.parameters.json"
7070
New-AzManagementGroupDeployment @params
7171
New-AzResourceGroupDeployment -Name 'AzOps-Tests-policyuam' -ResourceGroupName App1-azopsrg -TemplateFile "$($global:testRoot)/templates/policywithuam.bicep" -TemplateParameterFile "$($global:testRoot)/templates/policywithuam.bicepparam"
7272
# Pause for resource consistency

src/tests/subscriptiononly/SubOnly.Tests.ps1

+1-1
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ Describe "SubscriptionOnly" {
5353

5454
Write-PSFMessage -Level Verbose -Message "Creating repository test environment" -FunctionName "BeforeAll"
5555
try {
56-
$rg = New-AzSubscriptionDeployment -Name 'AzOps-Tests-SubOnly-RG' -Location 'northeurope' -TemplateParameterFile "$($global:testRoot)/templates/rgsubonlydeploy.parameters.json" -TemplateFile "$($global:testRoot)/templates/rgsubonlydeploy.bicep"
56+
$rg = New-AzDeployment -Name 'AzOps-Tests-SubOnly-RG' -Location 'northeurope' -TemplateParameterFile "$($global:testRoot)/templates/rgsubonlydeploy.parameters.json" -TemplateFile "$($global:testRoot)/templates/rgsubonlydeploy.bicep"
5757
$sta = New-AzResourceGroupDeployment -Name 'AzOps-Tests-SubOnly-Sta' -ResourceGroupName $rg.Parameters.resourceGroupName.Value -TemplateFile "$($global:testRoot)/templates/stasubonlydeploy.bicep"
5858
# Pause for resource consistency
5959
Start-Sleep -Seconds 120

0 commit comments

Comments
 (0)