Skip to content

Commit 37e1f23

Browse files
authored
Bump Dependencies (#924)
* Update * Update * Update * Update * update * Update * Update
1 parent 676cdef commit 37e1f23

4 files changed

Lines changed: 22 additions & 16 deletions

File tree

scripts/Remove-AzOpsTestsDeployment.ps1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22

33
<#
44
.SYNOPSIS
5-
Assist in removal of AzOps Test Deployments, destructive command removes resources in the context executed.
5+
Removes all resources and configurations created by AzOps test deployments. This is a destructive operation intended for cleaning up test environments.
66
.DESCRIPTION
7-
Assist in removal of AzOps Test Deployments, destructive command removes resources in the context executed.
7+
This command assists in cleaning up resources, management groups, role assignments, policy assignments, and deployments created during AzOps testing. It is intended for use in test or development environments only, as it will permanently delete resources in the current context.
88
.EXAMPLE
99
> Remove-AzOpsTestsDeployment -CleanupEnvironment:$true
1010
#>

src/AzOps.psd1

Lines changed: 4 additions & 4 deletions
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/24/2025
6+
# Generated on: 5/20/2025
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.12.346'; },
55-
@{ModuleName = 'Az.Accounts'; RequiredVersion = '4.0.2'; },
55+
@{ModuleName = 'Az.Accounts'; RequiredVersion = '5.0.0'; },
5656
@{ModuleName = 'Az.Billing'; RequiredVersion = '2.2.0'; },
57-
@{ModuleName = 'Az.ResourceGraph'; RequiredVersion = '1.2.0'; },
58-
@{ModuleName = 'Az.Resources'; RequiredVersion = '7.9.0'; })
57+
@{ModuleName = 'Az.ResourceGraph'; RequiredVersion = '1.2.1'; },
58+
@{ModuleName = 'Az.Resources'; RequiredVersion = '8.0.0'; })
5959

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

src/localized/en-us/Strings.psd1

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@
215215
'Invoke-AzOpsPush.Change.Delete.TempFile' = 'Creating temporary file dir for deletion processing: {0}' # $fileName
216216
'Invoke-AzOpsPush.Change.Delete.NextTempFile' = 'Exiting while loop, file detected in $DeleteSetContents for deletion processing based on this content line: [{0}]' # $currentLine
217217
'Invoke-AzOpsPush.Change.Delete.SetTempFileContent' = 'Set temporary file content: [{1}], in [{0}]' # $fileName, $jsonValue
218-
'Invoke-AzOpsPush.Deletion.Failed' = 'Deletion of resources {0}, has failed using templates: {1}, {2}, this could be due to delayed deletion acceptance from Azure, please investigate and take action.' # $fail.ScopeObject.Scope, $fail.TemplateFilePath, $fail.TemplateParameterFilePath
218+
'Invoke-AzOpsPush.Deletion.Failed' = 'Deletion of resources {0}, have failed using templates: {1}, {2}, this could be due to delayed deletion acceptance from Azure, please investigate and take action.' # $fail.ScopeObject.Scope, $fail.TemplateFilePath, $fail.TemplateParameterFilePath
219219
'Invoke-AzOpsPush.Deletion.Retry' = 'Deletion of {0} resources unsuccessful, initiate final retry combination.' # $retry.Count
220220
'Invoke-AzOpsPush.Deploy.ProviderFeature' = 'Invoking new state deployment - *.providerfeatures.json for a file {0}' # $addition
221221
'Invoke-AzOpsPush.Deploy.ResourceProvider' = 'Invoking new state deployment - *.resourceproviders.json for a file {0}' # $addition
@@ -230,16 +230,16 @@
230230
'Invoke-AzOpsPush.Deployment.TemporaryDeploymentStackTemplateFilePath.Exist' = 'Temporary processing deployment template file [{0}] already exists for [{1}]' # $tempDeploymentFilePath, $target.TemplateFilePath
231231
'Invoke-AzOpsPush.Deployment.TemporaryDeploymentStackTemplateFilePath.Remove' = 'Removing temporary processing deployment template file [{0}]' # $tempDeploymentFilePath
232232
'Invoke-AzOpsPush.Deployment.TemporaryDeploymentStackTemplateFilePath.New' = 'Create temporary processing deployment template file [{0}] for [{1}]' # $tempDeploymentFilePath, $target.TemplateFilePath
233-
'Invoke-AzOpsPush.Dependency.Missing' = 'Missing resource dependency for successfull deletion. Error exiting runtime.'
233+
'Invoke-AzOpsPush.Dependency.Missing' = 'Missing resource dependency for successful deletion. Error exiting runtime.'
234234
'Invoke-AzOpsPush.DeploymentList.NotFound' = 'Expecting deploymentList object, it was not found. Error exiting runtime.'
235235
'Invoke-AzOpsPush.Duration' = 'AzOps Push completed in {0}' # $stopWatch.Elapsed
236236
'Invoke-AzOpsPush.Resolve.DeployDeletionOverlap' = 'The file: {0} is targeted for deletion, skipping deployment file association' #
237237
'Invoke-AzOpsPush.Resolve.FoundTemplate' = 'Found template {1} for parameters {0}' # $FilePath, $templatePath
238238
'Invoke-AzOpsPush.Resolve.FoundBicepTemplate' = 'Found Bicep template {1} for parameters {0}' # $FilePath, $bicepTemplatePath
239239
'Invoke-AzOpsPush.Resolve.FromMainTemplate' = 'Determining template from main template file: {0}' # $mainTemplateItem.FullName
240-
'Invoke-AzOpsPush.Resolve.MainTemplate.NotSupported' = 'effectiveResourceType: {0} AzOpsMainTemplate does NOT supports resource type {0} in {1}. Deployment will be ignored' # $effectiveResourceType, $AzOpsMainTemplate.FullName
240+
'Invoke-AzOpsPush.Resolve.MainTemplate.NotSupported' = 'effectiveResourceType: {0} AzOpsMainTemplate does NOT support resource type {0} in {1}. Deployment will be ignored' # $effectiveResourceType, $AzOpsMainTemplate.FullName
241241
'Invoke-AzOpsPush.Resolve.MultipleTemplateParameterFile' = 'Found AllowMultipleTemplateParameterFile {0}' # $FilePath
242-
'Invoke-AzOpsPush.Resolve.MainTemplate.Supported' = 'effectiveResourceType: {0} - AzOpsMainTemplate supports resource type {0} in {1}' # $effectiveResourceType, $AzOpsMainTemplate.FullName
242+
'Invoke-AzOpsPush.Resolve.MainTemplate.Supported' = 'effectiveResourceType: {0} - AzOpsMainTemplate support resource type {0} in {1}' # $effectiveResourceType, $AzOpsMainTemplate.FullName
243243
'Invoke-AzOpsPush.Resolve.NoJson' = 'The specified file is not a json or bicep file! Skipping {0}' # $fileItem.FullName
244244
'Invoke-AzOpsPush.Resolve.NotFoundTemplate' = 'Did NOT find template {1} for parameters {0}' # $FilePath, $templatePath
245245
'Invoke-AzOpsPush.Resolve.ParameterFound' = 'Found parameter file for template {0} : {1}' # $FilePath, $parameterPath
@@ -353,7 +353,7 @@
353353
'Set-AzOpsWhatIfOutput.WhatIfFile' = 'Creating WhatIf markdown and json files' #
354354
'Set-AzOpsWhatIfOutput.WhatIfFileAdding' = 'Adding content to WhatIf {0} file for template {1} with parameter file {2}' # '<type>', $FilePath, $ParameterFilePath
355355
'Set-AzOpsWhatIfOutput.WhatIfFileMax' = 'WhatIf markdown and json files have reached character limit, unable to append more information to files. WhatIf is too large for comment field, for more details look at PR files to determine changes.' # $ResultSizeMaxLimit, $ResultSizeLimit
356-
'Set-AzOpsWhatIfOutput.WhatIfMessageMax' = 'WhatIf have reached maximum character limit, unable to append warning message. WhatIf is too large for comment field, for more details look at PR files to determine changes.' # $ResultSizeMaxLimit, $ResultSizeLimit
356+
'Set-AzOpsWhatIfOutput.WhatIfMessageMax' = 'WhatIf has reached maximum character limit, unable to append warning message. WhatIf is too large for comment field, for more details look at PR files to determine changes.' # $ResultSizeMaxLimit, $ResultSizeLimit
357357
'Set-AzOpsWhatIfOutput.WhatIfResults' = 'WhatIf Output {0}' # $results or $allResults
358358
'Set-AzOpsWhatIfOutput.WhatIfFile.Remove' = 'Removing WhatIf markdown and json files lingering from previous run' #
359359
}

src/tests/integration/Repository.Tests.ps1

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,9 @@ Describe "Repository" {
102102
throw
103103
}
104104

105+
# Pause for resource consistency
106+
Start-Sleep -Seconds 120
107+
105108
# Wait for Management Group structure consistency
106109

107110
$script:managementGroupDeployment = (Get-AzManagementGroupDeployment -ManagementGroupId "$script:tenantId" -Name "AzOps-Tests")
@@ -166,11 +169,13 @@ Describe "Repository" {
166169
$script:policyExemptions = Get-AzPolicyExemption -Name "PolicyExemptionTest" -Scope "/subscriptions/$script:subscriptionId"
167170
$script:routeTable = (Get-AzResource -Name "RouteTable" -ResourceGroupName $script:resourceGroup.ResourceGroupName)
168171
$script:policyAssignmentsDeletion = Get-AzPolicyAssignment -Name "TestPolicyAssignmentDeletion" -Scope "/subscriptions/$script:subscriptionId/resourceGroups/$($script:resourceGroupCustomDeletion.ResourceGroupName)"
169-
$script:ruleCollectionGroups = (Get-AzResource -ExpandProperties -Name "TestPolicy" -ResourceGroupName $($script:resourceGroup).ResourceGroupName).Properties.ruleCollectionGroups.id.split("/")[-1]
172+
$firewallPolicy = Search-AzGraph -Subscription $script:subscriptionId -Query "resources | where type == 'microsoft.network/firewallpolicies' and resourceGroup =~ '$($script:resourceGroup.ResourceGroupName)' and name =~ 'TestPolicy'" | Select-Object -First 1
173+
$script:ruleCollectionGroups = $firewallPolicy.Properties.ruleCollectionGroups | ForEach-Object { $_.id.Split('/')[-1] }
170174
$script:logAnalyticsWorkspace = (Get-AzResource -Name "thisisalongloganalyticsworkspacename123456789011121314151617181" -ResourceGroupName $($script:resourceGroup).ResourceGroupName)
171175
}
172176
catch {
173177
Write-PSFMessage -Level Critical -Message "Failed to get deployed services" -Exception $_.Exception -FunctionName "BeforeAll"
178+
throw
174179
}
175180

176181
# Invoke the Invoke-AzOpsPull function to generate the scope data which can be tested against to ensure structure is correct and data model hasn't changed.
@@ -1291,14 +1296,15 @@ Describe "Repository" {
12911296
Start-Sleep -Seconds 60
12921297
$script:deployAllStaParamPathDeployment = Get-AzResource -ResourceGroupName $script:resourceGroupParallelDeploy.ResourceGroupName -ResourceType 'Microsoft.Storage/storageAccounts'
12931298
$script:deployAllStaParamPathDeployment.Count | Should -Be 4
1294-
$query = "resourcechanges | where resourceGroup =~ '$($($script:resourceGroupParallelDeploy).ResourceGroupName)' and properties.targetResourceType == 'microsoft.storage/storageaccounts' and properties.changeType == 'Create' | extend changeTime=todatetime(properties.changeAttributes.timestamp), targetResourceId=tostring(properties.targetResourceId) | summarize arg_max(changeTime, *) by targetResourceId | project changeTime, targetResourceId, properties.changeType, properties.targetResourceType | order by changeTime asc"
1295-
$createTime = Search-AzGraph -Query $query -Subscription $script:subscriptionId
1296-
$parallelTimes = $createTime | Where-Object { $_.targetResourceId -match '^.*/p[123]azops' } | Select-Object -ExpandProperty changeTime
1299+
$deployments = Get-AzResourceGroupDeployment -ResourceGroupName $script:resourceGroupParallelDeploy.ResourceGroupName
1300+
$parallelDeployments = $deployments | Where-Object { $_.Parameters.staName.Value -match '^p[123]azops$' }
1301+
$serialDeployment = $deployments | Where-Object { $_.Parameters.staName.Value -eq 's1azops' }
1302+
$parallelTimes = $parallelDeployments | Select-Object -ExpandProperty Timestamp
12971303
$maxParallel = ($parallelTimes | Measure-Object -Maximum).Maximum
12981304
$minParallel = ($parallelTimes | Measure-Object -Minimum).Minimum
12991305
$diffParallel = New-TimeSpan -Start $minParallel -End $maxParallel
13001306
$diffParallel.TotalSeconds | Should -BeLessThan 25
1301-
$serialTime = ($createTime | Where-Object { $_.targetResourceId -match '^.*/s1azops' }).changeTime
1307+
$serialTime = $serialDeployment.Timestamp
13021308
$diffSerial = New-TimeSpan -Start $maxParallel -End $serialTime
13031309
$diffSerial.TotalSeconds | Should -BeGreaterThan 15
13041310
Set-PSFConfig -FullName AzOps.Core.AllowMultipleTemplateParameterFiles -Value $false

0 commit comments

Comments
 (0)