-
Notifications
You must be signed in to change notification settings - Fork 31
/
azure-pipelines.yml
65 lines (57 loc) · 1.93 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
60
61
62
63
64
65
# Pipeline to validate and deploy ARM templates
trigger:
branches:
include:
- master
paths:
exclude:
- README.md
variables:
# Deployment location
location: 'West Europe'
# Base URI for ARM templates
templateBaseUrl: 'https://raw.githubusercontent.com/andrewmatveychuk/azure.policy/master'
stages:
- stage: Validate
displayName: Validate
jobs:
- job: ValidateJob
displayName: Validate the ARM templates
pool:
vmImage: 'windows-latest'
steps:
- task: AzureResourceManagerTemplateDeployment@3
displayName: Validate main template
inputs:
deploymentScope: 'Subscription'
ConnectedServiceName: $(subscriptionName)
subscriptionName: $(subscriptionId)
location: '$(location)'
templateLocation: 'URL of the file'
csmFileLink: '$(templateBaseUrl)/main-template/azuredeploy.json'
csmParametersFileLink: '$(templateBaseUrl)/main-template/azuredeploy.parameters.json'
deploymentMode: 'Validation'
- stage: DeployToTestEnvironment
displayName: Deploy to test
dependsOn: Validate
jobs:
- deployment: DeploymentJob
displayName: Deploy ARM templates
pool:
vmImage: 'windows-latest'
environment: 'Test'
strategy:
runOnce:
deploy:
steps:
- task: AzureResourceManagerTemplateDeployment@3
displayName: Deploy policies
inputs:
deploymentScope: 'Subscription'
ConnectedServiceName: $(subscriptionName)
subscriptionName: $(subscriptionId)
location: '$(location)'
templateLocation: 'URL of the file'
csmFileLink: '$(templateBaseUrl)/main-template/azuredeploy.json'
csmParametersFileLink: '$(templateBaseUrl)/main-template/azuredeploy.parameters.json'
deploymentMode: 'Incremental'