-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Unable to deploy azure nodejs functions with nested directory structure using Azure pipeline #402
Description
Hello,
I am trying to deploy Azure Functions with a nested directory structure using Azure Pipeline, but it's not working. When I place the function directories in the root directory, it works fine, but when I place the function in a nested directory, it's not working. I have followed the instructions in the documentation mentioned below, but it's not working:
Here's an example of the directory structure I'm using:
├── host.json
├── nested
│ ├── foo
│ │ ├── function.json
│ │ └── index.js
│ ├── bar
│ │ ├── function.json
│ │ └── index.js
│ └── baz
│ ├── function.json
│ └── index.js
├── package.json
└── README.md
Here's my azurepipeline.yaml file:
`pool:
name: Azure Pipelines
steps:
-
task: NodeTool@0
displayName: 'Use Node version'
inputs:
versionSpec: 18.x -
task: Npm@1
displayName: 'Install Application Dependencies'
inputs:
workingDir: '$(System.DefaultWorkingDirectory)'
verbose: false -
task: Npm@1
displayName: 'Run ''build'' script'
inputs:
command: custom
workingDir: '$(System.DefaultWorkingDirectory)'
verbose: false
customCommand: 'run build --if-present' -
task: Npm@1
displayName: 'Remove extraneous packages'
inputs:
command: custom
workingDir: '$(System.DefaultWorkingDirectory)'
verbose: false
customCommand: 'prune --production' -
task: ArchiveFiles@2
inputs:
rootFolderOrFile: '$(System.DefaultWorkingDirectory)'
includeRootFolder: false
archiveType: 'zip'
archiveFile: '$(Build.ArtifactStagingDirectory)/$(Build.BuildId).zip'
replaceExistingArchive: true
displayName: 'Archive files' -
task: PublishBuildArtifacts@1
inputs:
artifactName: 'drop'
pathtoPublish: '$(Build.ArtifactStagingDirectory)/$(Build.BuildId).zip'
displayName: 'Publish build artifacts' -
task: DownloadBuildArtifacts@0
inputs:
buildType: 'current'
downloadType: 'single'
artifactName: 'drop'
downloadPath: '$(System.DefaultWorkingDirectory)'
displayName: 'Download build artifacts' -
task: AzureFunctionApp@1
inputs:
azureSubscription: Pay-As-You-Go
appType: functionApp
appName: kljdsaglkds
package:$(System.DefaultWorkingDirectory)/drop/$ (Build.BuildId).zip
displayName: 'Deploy to Azure Function App'`
Could you please help me with an example of how to deploy Azure Functions with a nested directory structure using Azure Pipeline? Thank you.