Skip to content

Commit

Permalink
Update Template Api Versions (#872)
Browse files Browse the repository at this point in the history
* UpdateModule

* Update-Command

* UpdateApiVersions

* UpdateApiVersion
  • Loading branch information
Jefajers committed Apr 5, 2024
1 parent 02c19f0 commit cdafd15
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 26 deletions.
4 changes: 2 additions & 2 deletions scripts/New-AzOpsTestsDeploymentHelper.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -95,10 +95,10 @@
try {
Write-PSFMessage -Level Verbose -Message "Deployment of $script:resourceType starting at $Scope scope."
if ($script:templateParametersFile) {
$script:functionalTestDeploy = New-AzSubscriptionDeployment -Name ($script:resourceType + 'testdeploy') -TemplateFile $script:templateFile -TemplateParameterFile $script:templateParametersFile -Location $Location -Confirm:$false
$script:functionalTestDeploy = New-AzDeployment -Name ($script:resourceType + 'testdeploy') -TemplateFile $script:templateFile -TemplateParameterFile $script:templateParametersFile -Location $Location -Confirm:$false
}
else {
$script:functionalTestDeploy = New-AzSubscriptionDeployment -Name ($script:resourceType + 'testdeploy') -TemplateFile $script:templateFile -Location $Location -Confirm:$false
$script:functionalTestDeploy = New-AzDeployment -Name ($script:resourceType + 'testdeploy') -TemplateFile $script:templateFile -Location $Location -Confirm:$false
}
$script:return = [PSCustomObject]@{
functionalTestDeploy = $script:functionalTestDeploy
Expand Down
6 changes: 3 additions & 3 deletions src/AzOps.psd1
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#
# Generated by: Customer Architecture Team (CAT)
#
# Generated on: 03/21/2024
# Generated on: 4/3/2024
#

@{
Expand Down Expand Up @@ -52,10 +52,10 @@ PowerShellVersion = '7.2'

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

# Assemblies that must be loaded prior to importing this module
# RequiredAssemblies = @()
Expand Down
36 changes: 18 additions & 18 deletions src/data/template/template.json
Original file line number Diff line number Diff line change
Expand Up @@ -86,21 +86,21 @@
json('null')
)]",
"apiVersionLookup": {
"Microsoft.Resources/resourceGroups":"2020-06-01",
"Microsoft.Authorization/policyAssignments": "2020-03-01",
"Microsoft.Authorization/policyDefinitions": "2020-03-01",
"Microsoft.Authorization/PolicySetDefinitions": "2020-03-01",
"Microsoft.Authorization/roleDefinitions": "2018-01-01-preview",
"Microsoft.Authorization/roleAssignments": "2020-04-01-preview",
"Microsoft.PolicyInsights/remediations": "2019-07-01",
"Microsoft.ContainerService/ManagedClusters": "2020-09-01",
"Microsoft.KeyVault/vaults":"2019-09-01",
"Microsoft.Resources/resourceGroups":"2023-07-01",
"Microsoft.Authorization/policyAssignments": "2023-04-01",
"Microsoft.Authorization/policyDefinitions": "2023-04-01",
"Microsoft.Authorization/policySetDefinitions": "2023-04-01",
"Microsoft.Authorization/roleDefinitions": "2022-04-01",
"Microsoft.Authorization/roleAssignments": "2022-04-01",
"Microsoft.PolicyInsights/remediations": "2021-10-01",
"Microsoft.ContainerService/managedClusters": "2024-02-01",
"Microsoft.KeyVault/vaults":"2023-07-01",
"Microsoft.Network/virtualWans": "2020-05-01",
"Microsoft.Network/virtualHubs": "2020-05-01",
"Microsoft.Network/virtualNetworks": "2020-06-01",
"Microsoft.Network/azureFirewalls": "2020-06-01",
"/providers/Microsoft.Management/managementGroups": "2020-05-01",
"/subscriptions": "2020-05-01",
"/providers/Microsoft.Management/managementGroups": "2023-04-01",
"/subscriptions": "2021-10-01",
"na": "9999-99-99",
"": "0000-00-00"
},
Expand Down Expand Up @@ -316,7 +316,7 @@
"scope": "[concat('Microsoft.Management/managementGroups/',parameters('input').name)]",
*/
"type": "Microsoft.Resources/deployments",
"apiVersion": "2019-10-01",
"apiVersion": "2023-07-01",
"location": "[deployment().location]",
"name": "[if(
and(contains(parameters('input'), 'children'),not(empty(parameters('input').children))),
Expand Down Expand Up @@ -411,7 +411,7 @@
},
"scope": "[concat('Microsoft.Management/managementGroups/',parameters('input').name)]",
"type": "Microsoft.Resources/deployments",
"apiVersion": "2020-06-01",
"apiVersion": "2023-07-01",
"location": "[deployment().location]",
"name": "[if(
and(
Expand Down Expand Up @@ -509,7 +509,7 @@
},
"scope": "[concat('Microsoft.Management/managementGroups/',parameters('input').name)]",
"type": "Microsoft.Resources/deployments",
"apiVersion": "2020-06-01",
"apiVersion": "2023-07-01",
"location": "[deployment().location]",
"name": "[if(
and(
Expand Down Expand Up @@ -608,7 +608,7 @@
},
"scope": "[concat('Microsoft.Management/managementGroups/',parameters('input').name)]",
"type": "Microsoft.Resources/deployments",
"apiVersion": "2020-06-01",
"apiVersion": "2023-07-01",
"location": "[deployment().location]",
"name": "[if(
and(
Expand Down Expand Up @@ -705,7 +705,7 @@
},
"scope": "[concat('Microsoft.Management/managementGroups/',parameters('input').name)]",
"type": "Microsoft.Resources/deployments",
"apiVersion": "2020-06-01",
"apiVersion": "2023-07-01",
"location": "[deployment().location]",
"name": "[if(
and(
Expand Down Expand Up @@ -802,7 +802,7 @@
},
"scope": "[concat('Microsoft.Management/managementGroups/',parameters('input').name)]",
"type": "Microsoft.Resources/deployments",
"apiVersion": "2020-06-01",
"apiVersion": "2023-07-01",
"location": "[deployment().location]",
"name": "[if(
and(
Expand Down Expand Up @@ -885,4 +885,4 @@
"value": "[uri(parameters('_artifactsLocation'), concat('template.json', parameters('_artifactsLocationSasToken')))]"
}
}
}
}
2 changes: 1 addition & 1 deletion src/internal/functions/New-AzOpsDeployment.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@
Write-AzOpsMessage -LogLevel Verbose -LogString 'New-AzOpsDeployment.Subscription.Processing' -LogStringValues $defaultDeploymentRegion, $scopeObject -Target $scopeObject
Set-AzOpsContext -ScopeObject $scopeObject
$whatIfCommand = 'Get-AzSubscriptionDeploymentWhatIfResult'
$deploymentCommand = 'New-AzSubscriptionDeployment'
$deploymentCommand = 'New-AzDeployment'
}
# Management Groups
elseif ($scopeObject.managementGroup -and (-not ($scopeObject.StatePath).StartsWith('azopsscope-assume-new-resource_'))) {
Expand Down
2 changes: 1 addition & 1 deletion src/tests/integration/Repository.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ Describe "Repository" {
Location = "northeurope"
}
try {
New-AzSubscriptionDeployment -Name 'AzOps-Tests-rbacdep' -Location northeurope -TemplateFile "$($global:testRoot)/templates/rbactest.bicep" -TemplateParameterFile "$($global:testRoot)/templates/rbactest.parameters.json"
New-AzDeployment -Name 'AzOps-Tests-rbacdep' -Location northeurope -TemplateFile "$($global:testRoot)/templates/rbactest.bicep" -TemplateParameterFile "$($global:testRoot)/templates/rbactest.parameters.json"
New-AzManagementGroupDeployment @params
New-AzResourceGroupDeployment -Name 'AzOps-Tests-policyuam' -ResourceGroupName App1-azopsrg -TemplateFile "$($global:testRoot)/templates/policywithuam.bicep" -TemplateParameterFile "$($global:testRoot)/templates/policywithuam.bicepparam"
# Pause for resource consistency
Expand Down
2 changes: 1 addition & 1 deletion src/tests/subscriptiononly/SubOnly.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ Describe "SubscriptionOnly" {

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

0 comments on commit cdafd15

Please sign in to comment.