Created
June 20, 2026 15:15
-
-
Save ChrFrohn/74481111bbbdafd88838927dac4682f4 to your computer and use it in GitHub Desktop.
AzureFunctionDeploy.yml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| trigger: | |
| - main | |
| variables: | |
| azureSubscription: '<Your-Service-Connection-Name>' | |
| functionAppName: '<Your-Azure-Functions-Name>' | |
| vmImageName: 'windows-latest' | |
| workingDirectory: '$(System.DefaultWorkingDirectory)/<RepoPath>/<RepoPath>/FunctionApp' | |
| stages: | |
| - stage: Build | |
| displayName: Build stage | |
| jobs: | |
| - job: Build | |
| displayName: Build | |
| pool: | |
| vmImage: $(vmImageName) | |
| steps: | |
| - task: ArchiveFiles@2 | |
| displayName: 'Archive files' | |
| inputs: | |
| rootFolderOrFile: $(workingDirectory) | |
| includeRootFolder: false | |
| archiveType: zip | |
| archiveFile: $(Build.ArtifactStagingDirectory)/$(Build.BuildId).zip | |
| replaceExistingArchive: true | |
| - publish: $(Build.ArtifactStagingDirectory)/$(Build.BuildId).zip | |
| artifact: drop | |
| - stage: Deploy | |
| displayName: Deploy stage | |
| dependsOn: Build | |
| condition: succeeded() | |
| jobs: | |
| - deployment: Deploy | |
| displayName: Deploy | |
| environment: $(functionAppName) | |
| pool: | |
| vmImage: $(vmImageName) | |
| strategy: | |
| runOnce: | |
| deploy: | |
| steps: | |
| - task: AzureFunctionApp@2 | |
| displayName: 'Azure functions app deploy' | |
| inputs: | |
| connectedServiceNameARM: '$(azureSubscription)' | |
| appType: functionApp | |
| appName: $(functionAppName) | |
| package: '$(Pipeline.Workspace)/drop/$(Build.BuildId).zip' | |
| deploymentMethod: runFromPackage |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment