这就是我所做的
Build
Azure DevOps中CI/CD管道上的Azure函数服务总线队列触发器(在Node.Js中):
在将此功能部署到azure之后将其添加到以下步骤之前,我得到
serviceBusTrigger is not registered
错误:
- script: 'func extensions install --package Microsoft.Azure.WebJobs.ServiceBus --version 3.0.0-beta8'
displayName: 'install servicebus extension'
- script: 'func extensions install --package Microsoft.Azure.WebJobs.Script.ExtensionsMetadataGenerator --version 1.0.1'
displayName: 'install azure WebJobs ExtensionsMetadataGenerator'
但在添加了如下所示的步骤之后,它工作得很好。
我在Azure DevOps构建管道上使用了这个YAML,它对我很有用:
pool:
vmImage: windows-2019
demands: npm
steps:
- script: 'func extensions install --package Microsoft.Azure.WebJobs.ServiceBus --version 3.0.0-beta8'
displayName: 'install servicebus extension'
- script: 'func extensions install --package Microsoft.Azure.WebJobs.Script.ExtensionsMetadataGenerator --version 1.0.1'
displayName: 'install azure WebJobs ExtensionsMetadataGenerator'
- task: NodeTool@0
inputs:
versionSpec: '10.x'
- task: Npm@1
displayName: 'npm install'
inputs:
command: install
- task: Npm@1
displayName: 'npm az core tools'
inputs:
command: custom
verbose: false
customCommand: 'i -g azure-functions-core-tools@core --unsafe-perm t'
- task: PublishTestResults@2
inputs:
testResultsFiles: '**/TEST-RESULTS.xml'
testRunTitle: 'Test results for JavaScript'
condition: succeededOrFailed()
- task: ArchiveFiles@2
inputs:
rootFolderOrFile: '$(System.DefaultWorkingDirectory)'
includeRootFolder: false
archiveFile: "$(System.DefaultWorkingDirectory)/FunctionApp.zip"
- task: CopyFiles@2
inputs:
SourceFolder: '$(System.DefaultWorkingDirectory)'
TargetFolder: '$(Build.ArtifactStagingDirectory)'
- task: PublishBuildArtifacts@1
inputs:
PathtoPublish: "$(Build.ArtifactStagingDirectory)"
ArtifactName: "drop"