-
Notifications
You must be signed in to change notification settings - Fork 1
/
azure-pipelines.yml
59 lines (53 loc) · 1.83 KB
/
azure-pipelines.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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
trigger: none
pr: none
parameters:
- name: location
default: eastus
type: string
values:
- eastus
- eastus2
- westcentralus
- westus
- westus2
- southcentralus
- northeurope
- westeurope
- name: resourceGroupName
default: WVD-RGP-ImageBuilder
type: string
- name: templateParametersFile
type: string
default: Templates/image-builder.params.tyler.json
stages:
- stage: CreateImage
displayName: Create Image Stage
jobs:
- job: CreateImageJob
displayName: Create Image Job
variables:
imageTemplateName: WVD-AIB-$(Build.BuildNumber)
steps:
- task: AzureResourceGroupDeployment@2
inputs:
azureSubscription: $(AzureConnectionName)
resourceGroupName: ${{ parameters.resourceGroupName }}
location: ${{ parameters.location }}
templateLocation: Linked artifact
csmFile: $(Pipeline.Workspace)/s/Templates/image-builder.json
csmParametersFile: $(Pipeline.Workspace)/s/${{ parameters.templateParametersFile }}
overrideParameters: -imageTemplateName $(imageTemplateName)
deploymentOutputs: OutputsJson
- task: AzurePowerShell@4
displayName: Build Image from Template
inputs:
pwsh: true
azureSubscription: $(AzureConnectionName)
scriptType: InlineScript
azurePowerShellVersion: LatestVersion
inline: |
Invoke-AzResourceAction -Action Run `
-ResourceName $(imageTemplateName) `
-ResourceGroupName ${{ parameters.resourceGroupName }} `
-ResourceType 'Microsoft.VirtualMachineImages/imageTemplates' `
-Force -Verbose