1+ # .NET Core Function App to Windows on Azure
2+ # Build a .NET Core function app and deploy it to Azure as a Windows function App.
3+ # Add steps that analyze code, save build artifacts, deploy, and more:
4+ # https://docs.microsoft.com/en-us/azure/devops/pipelines/languages/dotnet-core
5+
6+ trigger :
7+ - main
8+
9+ variables :
10+ # Azure Resource Manager connection created during pipeline creation
11+ azureSubscription : ' dbd9bc02-3bce-4286-ad67-7aeff32534bf'
12+
13+ # Function app name
14+ functionAppName : ' func-azure-devops-state-tracker'
15+
16+ # Agent VM image name
17+ vmImageName : ' vs2017-win2016'
18+
19+ # Working Directory
20+ workingDirectory : ' $(System.DefaultWorkingDirectory)/AzureDevOpsStateTracker.Functions'
21+
22+ stages :
23+ - stage : Build
24+ displayName : Build stage
25+
26+ jobs :
27+ - job : Build
28+ displayName : Build
29+ pool :
30+ vmImage : $(vmImageName)
31+
32+ steps :
33+ - task : DotNetCoreCLI@2
34+ displayName : Build
35+ inputs :
36+ command : ' build'
37+ projects : |
38+ $(workingDirectory)/*.csproj
39+ arguments : --output $(System.DefaultWorkingDirectory)/publish_output --configuration Release
40+
41+ - task : ArchiveFiles@2
42+ displayName : ' Archive files'
43+ inputs :
44+ rootFolderOrFile : ' $(System.DefaultWorkingDirectory)/publish_output'
45+ includeRootFolder : false
46+ archiveType : zip
47+ archiveFile : $(Build.ArtifactStagingDirectory)/$(Build.BuildId).zip
48+ replaceExistingArchive : true
49+
50+ - publish : $(Build.ArtifactStagingDirectory)/$(Build.BuildId).zip
51+ artifact : drop
52+
53+ - stage : Deploy
54+ displayName : Deploy stage
55+ dependsOn : Build
56+ condition : succeeded()
57+
58+ jobs :
59+ - deployment : Deploy
60+ displayName : Deploy
61+ environment : ' development'
62+ pool :
63+ vmImage : $(vmImageName)
64+
65+ strategy :
66+ runOnce :
67+ deploy :
68+
69+ steps :
70+ - task : AzureFunctionApp@1
71+ displayName : ' Azure functions app deploy'
72+ inputs :
73+ azureSubscription : ' $(azureSubscription)'
74+ appType : functionApp
75+ appName : $(functionAppName)
76+ package : ' $(Pipeline.Workspace)/drop/$(Build.BuildId).zip'
0 commit comments