Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
81 commits
Select commit Hold shift + click to select a range
576fb66
Update to latest
AlexanderSehr Dec 8, 2021
e40e465
Update to latest
AlexanderSehr Dec 8, 2021
22ff682
Update to latest
AlexanderSehr Dec 8, 2021
6621582
Update to latest
AlexanderSehr Dec 8, 2021
a6f922f
Update to latest
AlexanderSehr Dec 8, 2021
989298a
Update to latest
AlexanderSehr Dec 8, 2021
9d4bee8
Update to latest
AlexanderSehr Dec 8, 2021
59d82d3
Update to latest
AlexanderSehr Dec 8, 2021
2a14077
Enabled removal for kvlt
AlexanderSehr Dec 8, 2021
64027d4
Update to latest
AlexanderSehr Dec 9, 2021
8153978
Update to latest
AlexanderSehr Dec 9, 2021
55c4940
Update to latest
AlexanderSehr Dec 9, 2021
69e89b3
Structured files & folders
AlexanderSehr Dec 9, 2021
0d1e743
Update to latest
AlexanderSehr Dec 9, 2021
d988863
Update to latest
AlexanderSehr Dec 9, 2021
2446675
Update to latest
AlexanderSehr Dec 9, 2021
11308a5
Update to latest
AlexanderSehr Dec 9, 2021
d696a79
Update to latest
AlexanderSehr Dec 9, 2021
dc965ff
Update to latest
AlexanderSehr Dec 9, 2021
abd9d83
Update to latest
AlexanderSehr Dec 9, 2021
26df7b6
Update to latest
AlexanderSehr Dec 9, 2021
e4ce3b0
Update to latest
AlexanderSehr Dec 9, 2021
0dd238b
Add private endpoint to removed resources
Dec 9, 2021
71b45ec
Update to latest
AlexanderSehr Dec 9, 2021
d46357d
Update to latest
AlexanderSehr Dec 10, 2021
4ecd4be
Update to latest
AlexanderSehr Dec 10, 2021
50eb523
Update to latest
AlexanderSehr Dec 10, 2021
cc242b0
Added missing reference
AlexanderSehr Dec 10, 2021
fa18b0e
Update to latest
AlexanderSehr Dec 10, 2021
ccda944
Update to latest
AlexanderSehr Dec 10, 2021
d86caf4
Update to latest
AlexanderSehr Dec 10, 2021
46cf29a
Update to latest
AlexanderSehr Dec 10, 2021
28439d3
Update to latest
AlexanderSehr Dec 10, 2021
654845e
Added better support for diagnostic settings removal
AlexanderSehr Dec 10, 2021
c27d594
Update to latest
AlexanderSehr Dec 10, 2021
4a04f0c
Update to latest
AlexanderSehr Dec 11, 2021
1df79e7
Update to latest
AlexanderSehr Dec 11, 2021
74a7f8b
Update to latest
AlexanderSehr Dec 11, 2021
1febecb
Update to latest
AlexanderSehr Dec 11, 2021
3d9dcca
Update to latest
AlexanderSehr Dec 11, 2021
cee645a
Update to latest
AlexanderSehr Dec 11, 2021
5786d22
Update to latest
AlexanderSehr Dec 11, 2021
2fa727d
Update to latest
AlexanderSehr Dec 11, 2021
f96972a
Update to latest
AlexanderSehr Dec 11, 2021
4f7c9ce
Update to latest
AlexanderSehr Dec 11, 2021
207a08c
Added missing Az modules
AlexanderSehr Dec 11, 2021
a80ba41
Update to latest
AlexanderSehr Dec 11, 2021
cb3a407
Update to latest
AlexanderSehr Dec 11, 2021
60b0865
Update to latest
AlexanderSehr Dec 11, 2021
7360661
Update to latest
AlexanderSehr Dec 11, 2021
b86edf0
Update to latest
AlexanderSehr Dec 11, 2021
234b131
Update to latest
AlexanderSehr Dec 11, 2021
e7e5661
Update to latest
AlexanderSehr Dec 11, 2021
4f4bcd5
Update to latest
AlexanderSehr Dec 11, 2021
62a290a
Update to latest
AlexanderSehr Dec 11, 2021
9d1ee58
Update to latest
AlexanderSehr Dec 11, 2021
6d4d7b0
Added cognitive services purge
AlexanderSehr Dec 11, 2021
e826bb2
Update to latest
AlexanderSehr Dec 11, 2021
055ed36
Update to latest
AlexanderSehr Dec 11, 2021
1d32148
Update to latest
AlexanderSehr Dec 11, 2021
abce8e3
Enabled purge on api management
AlexanderSehr Dec 11, 2021
1e92326
Update to latest
AlexanderSehr Dec 11, 2021
8444828
Fixed cognitive servies purge
AlexanderSehr Dec 11, 2021
e804c2f
Adjusted condition
AlexanderSehr Dec 12, 2021
8f54496
Update to latest
AlexanderSehr Dec 12, 2021
56b6c08
Merged with latest main
AlexanderSehr Dec 13, 2021
5902c69
Update to latest
AlexanderSehr Dec 13, 2021
70c3639
Update ADO removal invocation
AlexanderSehr Dec 13, 2021
5429aa6
Aligned casing
AlexanderSehr Dec 13, 2021
0756a24
Updated removal task to use individual parameters instead of one hash…
AlexanderSehr Dec 14, 2021
adc8877
Update to latest
AlexanderSehr Dec 14, 2021
4318ec4
Update removal (#810)
eriqua Dec 14, 2021
f5db96e
Refactored removal object interfact
AlexanderSehr Dec 14, 2021
e1b5b52
Update utilities/pipelines/resourceRemoval/helper/Invoke-ResourcePost…
AlexanderSehr Dec 14, 2021
e8b6632
Update to latest
AlexanderSehr Dec 14, 2021
4dd8bff
Update to latest
AlexanderSehr Dec 14, 2021
2a74cb4
Update to latest
AlexanderSehr Dec 14, 2021
2fc6e7d
Fix for deployment
AlexanderSehr Dec 15, 2021
21030d1
Update to latest
AlexanderSehr Dec 15, 2021
0873030
Update to latest
AlexanderSehr Dec 15, 2021
1ab290f
Update to latest
AlexanderSehr Dec 15, 2021
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
22 changes: 12 additions & 10 deletions .azuredevops/pipelineTemplates/module.jobs.deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@ jobs:
pwsh: true
inline: |
# Load used function
. (Join-Path '$(moduleRepoRoot)' '$(pipelineFunctionsPath)' 'resourceRemoval' 'Remove-DeployedModule.ps1')
. (Join-Path '$(moduleRepoRoot)' '$(pipelineFunctionsPath)' 'resourceRemoval' 'Initialize-DeploymentRemoval.ps1')

if(-not [String]::IsNullOrEmpty('${{ deploymentBlock.templateFilePath }}')) {
$templateFilePath = Join-Path '$(moduleRepoRoot)' '${{ deploymentBlock.templateFilePath }}'
Expand All @@ -289,14 +289,16 @@ jobs:
(Join-Path '$(ModuleRepoRoot)' '$(modulePath)' 'deploy.json')
}

$functionInput = @{
deploymentName = '$(deploymentName)'
templateFilePath = $templateFilePath
resourceGroupName = '${{ parameters.resourceGroupName }}'
verbose = $true
}
if (-not [String]::IsNullOrEmpty('$(deploymentName)')) {
$functionInput = @{
DeploymentName = '$(deploymentName)'
TemplateFilePath = $templateFilePath
ResourceGroupName = '${{ parameters.resourceGroupName }}'
Verbose = $true
}

Write-Verbose 'Invoke task with' -Verbose
Write-Verbose ($functionInput | ConvertTo-Json | Out-String) -Verbose
Write-Verbose 'Invoke task with' -Verbose
Write-Verbose ($functionInput | ConvertTo-Json | Out-String) -Verbose

Remove-DeployedModule @functionInput
Initialize-DeploymentRemoval @functionInput
}
32 changes: 15 additions & 17 deletions .github/actions/templates/validateModuleDeployment/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -143,23 +143,21 @@ runs:
# -----------------
- name: 'Remove [${{ inputs.templateFilePath }}] from parameters [${{ inputs.parameterFilePath }}]'
shell: pwsh
if: ${{ always() && steps.deploy_step.outputs.deploymentName != '' }}
if: ${{ always() && inputs.removeDeployment == 'true' && steps.deploy_step.outputs.deploymentName != '' }}
run: |
if('${{ inputs.removeDeployment }}' -eq 'true') {
# Load used function
. (Join-Path $env:GITHUB_WORKSPACE 'utilities' 'pipelines' 'resourceRemoval' 'Remove-DeployedModule.ps1')

if(-not [String]::IsNullOrEmpty('${{ steps.deploy_step.outputs.deploymentName }}')) {
$functionInput = @{
deploymentName = '${{ steps.deploy_step.outputs.deploymentName }}'
templateFilePath = Join-Path $env:GITHUB_WORKSPACE '${{ inputs.templateFilePath }}'
resourceGroupName = '${{ inputs.resourceGroupName }}'
verbose = $true
}

Write-Verbose 'Invoke task with' -Verbose
Write-Verbose ($functionInput | ConvertTo-Json | Out-String) -Verbose

Remove-DeployedModule @functionInput
# Load used function
. (Join-Path $env:GITHUB_WORKSPACE 'utilities' 'pipelines' 'resourceRemoval' 'Initialize-DeploymentRemoval.ps1')

if (-not [String]::IsNullOrEmpty('${{ steps.deploy_step.outputs.deploymentName }}')) {
$functionInput = @{
DeploymentName = '${{ steps.deploy_step.outputs.deploymentName }}'
TemplateFilePath = Join-Path $env:GITHUB_WORKSPACE '${{ inputs.templateFilePath }}'
ResourceGroupName = '${{ inputs.resourceGroupName }}'
Verbose = $true
}

Write-Verbose 'Invoke task with' -Verbose
Write-Verbose ($functionInput | ConvertTo-Json | Out-String) -Verbose

Initialize-DeploymentRemoval @functionInput
}
2 changes: 1 addition & 1 deletion .github/workflows/ms.insights.diagnosticsettings.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:
type: boolean
description: 'Remove deployed module'
required: false
default: 'false' # Needs custom removals script
default: 'true'
versioningOption:
type: choice
description: 'The mode to handle the version increments [major|minor|patch]'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ms.network.networkwatchers.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:
type: boolean
description: 'Remove deployed module'
required: false
default: 'false' # Required as a dependency + Only one Network Watcher can exist in the same location. If removed, a default would be created in a dedicated RG
default: 'false' # Only one Network Watcher can exist in the same location. If removed, a default would be created in a dedicated RG
versioningOption:
type: choice
description: 'The mode to handle the version increments [major|minor|patch]'
Expand Down
2 changes: 1 addition & 1 deletion docs/wiki/PipelinesDesign.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ Note that, for the deployments we have to account for certain [prerequisites](#p

#### Removal

The removal phase is strongly coupled with the previous deployment phase. Fundamentally, we want to remove any test-deployed resource after its test concluded. If we would not, we would generate unnecessary costs and may temper with any subsequent test. Some resources may require a dedicated logic to be removed. This logic should be stored alongside the generally utilized removal script in the `.utilities/pipelines/resourceRemoval` folder and be referenced by the `Remove-DeployedModule.ps1` script that orchestrates the removal.
The removal phase is strongly coupled with the previous deployment phase. Fundamentally, we want to remove any test-deployed resource after its test concluded. If we would not, we would generate unnecessary costs and may temper with any subsequent test. Some resources may require a dedicated logic to be removed. This logic should be stored alongside the generally utilized removal script in the `.utilities/pipelines/resourceRemoval` folder and be referenced by the `Initialize-DeploymentRemoval.ps1` script that orchestrates the removal.

Most of the removal scripts rely on the deployment name used during the preceding deployment step. Based on this name in combination with the template file path, the removal script find the corresponding deployment and removes all contained resources.

Expand Down
Loading