-
-
Notifications
You must be signed in to change notification settings - Fork 90
/
managedimage-cleanup-managedvm.yml
41 lines (39 loc) · 1.42 KB
/
managedimage-cleanup-managedvm.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
parameters:
- name: variable_group_name
displayName: Variable Group
type: string
default: 'Image Generation Variables'
- name: agent_pool
displayName: Agent Pool
type: string
default: 'Host Pool - Image'
- name: repository_base_path
displayName: Scripts Path
type: string
default: .
jobs:
- job: CleanOrphanedManagedImages
displayName: Cleanup orphaned Managed Images
timeoutInMinutes: 600
cancelTimeoutInMinutes: 30
variables:
- group: ${{ parameters.variable_group_name }}
steps:
- checkout: self
- ${{ if ne(parameters.repository_base_path, '.') }}:
- checkout: ${{ parameters.repository_base_path }}
- task: PowerShell@2
displayName: 'Cleanup orphaned Managed Images'
inputs:
targetType: filePath
filePath: ${{ parameters.repository_base_path }}/scripts/cleanup-managedimages.ps1
arguments: -ClientId $(CLIENT_ID) `
-ClientSecret $(CLIENT_SECRET) `
-ResourceGroup $(AZURE_RESOURCE_GROUP) `
-SubscriptionId $(AZURE_SUBSCRIPTION) `
-AgentsResourceGroup $(AZURE_AGENTS_RESOURCE_GROUP) `
-VmssNameWindows $(VMSS_Windows2019) `
-VmssNameWindows2022 $(VMSS_Windows2022) `
-VmssNameUbuntu $(VMSS_Ubuntu2004) `
-VmssNameUbuntu2204 $(VMSS_Ubuntu2204) `
-TenantId $(AZURE_TENANT)