Developed one azure Devops yaml pipeline to publish my azure function in the azure function app, even it is running fine but still even after the push I cannot see my azure function gets deployed in Azure yaml pipeline. However I can see in the azure function app "deployment center" I can see my commit ids but under the overview tab nothings is there.
Below is the YAML pipeline:
trigger: none
pool:
name: test
stages:
- stage: deploy_function_app
jobs:
- deployment: FunctionAppDeployment
displayName: 'Function App Deployment'
environment: dev
strategy:
runOnce:
deploy:
steps:
- checkout: self
clean: true
- task: ArchiveFiles@2
displayName: 'Create project zip'
inputs:
rootFolderOrFile: '$(System.DefaultWorkingDirectory)/src'
includeRootFolder: false
archiveType: 'zip'
archiveFile: '$(Build.ArtifactStagingDirectory)/functionapp.zip'
replaceExistingArchive: true
- task: PublishPipelineArtifact@1
displayName: 'Publish zip artifact'
inputs:
targetPath: '$(Build.ArtifactStagingDirectory)/functionapp.zip'
publishLocation: 'pipeline'
- task: AzureFunctionApp@1
displayName: 'Deploy Function App'
inputs:
azureSubscription: 'connection'
appType: 'functionapp'
appName: 'myfunctionsharat'
package: '$(Build.ArtifactStagingDirectory)/functionapp.zip'
deploymentMethod: 'zipDeploy'
I have checked the Github Repo sample and reproduced the same issue.
You can refer to the following steps to modify your project and Pipeline:
For the Repo Project, you need to add the Function.json file to the path: src/functions
Function.json sample:
File path:
For the Azure DevOps Pipeline, you need to Build the TS project first, then you can deploy the generated package to Azure Function.
Here is an example:
Result:
Refer to this doc: Azure Functions triggers and bindings concepts