-
Notifications
You must be signed in to change notification settings - Fork 92
/
dataManagementZoneDeployment.yml
128 lines (117 loc) · 4.77 KB
/
dataManagementZoneDeployment.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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
name: Data Management Zone Deployment
trigger:
branches:
include:
- main
paths:
include:
- infra/*
- code/*
- .ado/workflows/dataManagementZoneDeployment.yml
pr:
branches:
include:
- main
paths:
include:
- infra/*
- code/*
- .ado/workflows/dataManagementZoneDeployment.yml
variables:
AZURE_RESOURCE_MANAGER_CONNECTION_NAME: "data-management-zone-service-connection" # Update to '{yourResourceManagerConnectionName}'
AZURE_SUBSCRIPTION_ID: "17588eb2-2943-461a-ab3f-00a3ceac3112" # Update to '{yourDataManagementZoneSubscriptionId}'
AZURE_LOCATION: "northeurope" # Update to '{yourRegionName}'
stages:
- stage: Validation
displayName: "Validation of IaC templates"
jobs:
- job: Validation
displayName: "Validation of IaC templates"
continueOnError: false
pool:
vmImage: "ubuntu-latest"
steps:
# Checkout code
- checkout: self
name: checkout_repository
displayName: Checkout repository
submodules: true
lfs: false
clean: true
continueOnError: false
enabled: true
# Deploy Data Management Zone - validation
- task: AzureResourceManagerTemplateDeployment@3
name: data_management_zone_validation
displayName: Data Management Zone - validation
enabled: true
continueOnError: false
inputs:
deploymentScope: "Subscription"
azureResourceManagerConnection: ${{ variables.AZURE_RESOURCE_MANAGER_CONNECTION_NAME }}
subscriptionId: ${{ variables.AZURE_SUBSCRIPTION_ID }}
location: ${{ variables.AZURE_LOCATION }}
templateLocation: "Linked artifact"
csmFile: "$(System.DefaultWorkingDirectory)/infra/main.json"
csmParametersFile: "$(System.DefaultWorkingDirectory)/infra/params.dev.json"
deploymentMode: "Validation"
# Deploy Data Management Zone - what-if
- task: AzureCLI@2
name: data_management_zone_whatif
displayName: Deploy Data Management Zone - what-if
enabled: true
continueOnError: false
inputs:
azureSubscription: ${{ variables.AZURE_RESOURCE_MANAGER_CONNECTION_NAME }}
scriptType: pscore
scriptLocation: inlineScript
inlineScript: |
az account set `
--subscription ${{ variables.AZURE_SUBSCRIPTION_ID }}
az deployment sub what-if `
--location ${{ variables.AZURE_LOCATION }} `
--subscription ${{ variables.AZURE_SUBSCRIPTION_ID }} `
--exclude-change-types Ignore NoChange Unsupported `
--template-file "$(System.DefaultWorkingDirectory)/infra/main.json" `
--parameters "$(System.DefaultWorkingDirectory)/infra/params.dev.json" `
--result-format "FullResourcePayloads"
powerShellErrorActionPreference: "stop"
addSpnToEnvironment: false
useGlobalConfig: false
failOnStandardError: false
powerShellIgnoreLASTEXITCODE: false
- stage: Deployment
displayName: "Deployment of IaC templates"
dependsOn: Validation
# condition: and(succeeded(), in(variables['Build.Reason'], 'IndividualCI', 'BatchedCI'))
jobs:
- job: Deployment
displayName: "Deployment of IaC templates"
continueOnError: false
pool:
vmImage: "windows-latest"
steps:
# Checkout repository
- checkout: self
name: checkout_repository
displayName: "Checkout repository"
submodules: true
lfs: false
clean: true
continueOnError: false
enabled: true
# Deploy Data Management Zone
- task: AzureResourceManagerTemplateDeployment@3
name: data_management_zone_deployment
displayName: Data Management Zone
enabled: true
continueOnError: false
inputs:
deploymentScope: "Subscription"
azureResourceManagerConnection: ${{ variables.AZURE_RESOURCE_MANAGER_CONNECTION_NAME }}
subscriptionId: ${{ variables.AZURE_SUBSCRIPTION_ID }}
location: ${{ variables.AZURE_LOCATION }}
templateLocation: "Linked artifact"
csmFile: "$(System.DefaultWorkingDirectory)/infra/main.json"
csmParametersFile: "$(System.DefaultWorkingDirectory)/infra/params.dev.json"
deploymentMode: "Incremental"