-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnetcore-deploy-function.yml
More file actions
95 lines (77 loc) · 2.8 KB
/
netcore-deploy-function.yml
File metadata and controls
95 lines (77 loc) · 2.8 KB
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
parameters:
- name: functionApp
type: string
- name: projectName
type: string
default: '$(System.TeamProject)'
- name: runtime
type: string
default: ''
- name: appSettings
type: string
default: ''
- name: appServicePlan
type: string
default: ''
- name: targetEnvironment
type: string
values:
- dev
- prod
- qa
default: dev
- name: azureConnection
type: string
- name: provision
type: boolean
default: false
stages:
- stage: ${{ format('DeployFunctionApp_{0}', upper(parameters.targetEnvironment)) }}
variables:
${{ if eq(parameters.targetEnvironment, 'prod') }}:
prefix: ''
${{ if ne(parameters.targetEnvironment, 'prod') }}:
prefix: ${{ format('{0}-', parameters.targetEnvironment) }}
#FunctionApp.ServicePlan: ${{ coalesce(parameters.appServicePlan, format('ASP-{0}-{1}', parameters.projectName, parameters.targetEnvironment)) }}
FunctionApp.Name: ${{ format('{0}{1}', variables.prefix, parameters.functionApp) }}
#FunctionApp.Runtime: ${{ coalesce(parameters.runtime, 'DOTNETCORE:$(Global.dotnetVersion)') }} # SOLO EN LINUX
#Azure.Location: ${{ parameters.azureLocation }}
Azure.ResourceGroup: ${{ format('{0}{1}', variables.prefix, parameters.projectName) }}
jobs:
- deployment: deployWebAppJob
displayName: Deploy to Azure FunctionApp
environment: ${{ format('{0}-{1}', parameters.projectName, parameters.targetEnvironment) }}
strategy:
runOnce:
deploy:
steps:
- checkout: templates
path: templates
- pwsh: |
dir env:FUNCTIONAPP*
dir env:AZURE*
displayName: Show deploy parameters
# - task: CopyFiles@2
# displayName: Add repository custom scripts
# inputs:
# sourceFolder: $(Pipeline.Workspace)/drop
# contents: 'deploy/**'
# targetFolder: $(Pipeline.Workspace)/templates
# overwrite: true
# - task: AzureCLI@2
# displayName: Provisioning WebApp Service
# inputs:
# azureSubscription: ${{ parameters.azureConnection }}
# scriptType: pscore
# scriptLocation: scriptPath
# scriptPath: '$(Pipeline.Workspace)/templates/deploy/webapp.ps1'
# condition: and( succeeded(), eq(${{ parameters.provision }}, true) )
- task: AzureFunctionApp@1
displayName: Deploy FunctionApp
inputs:
azureSubscription: ${{ parameters.azureConnection }}
appType: functionApp
appName: $(FunctionApp.Name)
package: $(Pipeline.Workspace)/drop/*.zip
deploymentMethod: auto
appSettings: ${{ parameters.appSettings }}