forked from Azure/reliable-web-app-pattern-dotnet
-
Notifications
You must be signed in to change notification settings - Fork 1
/
azure-dev.yml
72 lines (64 loc) · 1.91 KB
/
azure-dev.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
# This file is part of the sample that you can use to build your devOps automation.
# See the README markdown file for further details
trigger:
- main
pool:
vmImage: ubuntu-latest
container: mcr.microsoft.com/azure-dev-cli-apps:latest
variables:
- name: env_name
value: $(AZD_AZURE_ENV_NAME)daily
steps:
- task: AzureCLI@2
displayName: Azure Dev Provision
inputs:
azureSubscription: azconnection
scriptType: bash
scriptLocation: inlineScript
inlineScript: |
azd provision --no-prompt
env:
AZURE_SUBSCRIPTION_ID: $(AZURE_SUBSCRIPTION_ID)
AZURE_ENV_NAME: $(env_name)
AZURE_LOCATION: $(AZURE_LOCATION)
- task: AzureCLI@2
# temporary work around for known issue with multiple resource groups
displayName: Set AZD resource group
inputs:
azureSubscription: azconnection
scriptType: bash
scriptLocation: inlineScript
inlineScript: |
azd env set AZURE_RESOURCE_GROUP $(env_name)-rg
- task: AzureCLI@2
displayName: Azure Dev Deploy
inputs:
azureSubscription: azconnection
scriptType: bash
scriptLocation: inlineScript
inlineScript: |
azd deploy --no-prompt
env:
AZURE_SUBSCRIPTION_ID: $(AZURE_SUBSCRIPTION_ID)
AZURE_ENV_NAME: $(env_name)
AZURE_LOCATION: $(AZURE_LOCATION)
- task: AzureCLI@2
displayName: QA - Validate Deployment
inputs:
azureSubscription: azconnection
scriptType: bash
scriptLocation: inlineScript
inlineScript: |
echo 'your tests here'
- task: AzureCLI@2
displayName: Azure Dev Down
inputs:
azureSubscription: azconnection
scriptType: bash
scriptLocation: inlineScript
inlineScript: |
azd down --force --purge --no-prompt
env:
AZURE_SUBSCRIPTION_ID: $(AZURE_SUBSCRIPTION_ID)
AZURE_ENV_NAME: $(env_name)
AZURE_LOCATION: $(AZURE_LOCATION)