你好,我創(chuàng)建了一個golang自定義處理程序azure函數(shù),我直接從VS代碼部署它,它就像一個魅力。我想用azure devops管道添加一些ci / cd,我設(shè)法構(gòu)建了一個工件,并將其發(fā)布在項目的已發(fā)布工件中,這里是.yml文件trigger:- mainpool: vmImage: ubuntu-lateststeps:- task: GoTool@0 inputs: version: '1.16'- task: Go@0 displayName: 'Build Application Binary' inputs: command: 'build' workingDirectory: '$(System.DefaultWorkingDirectory)/my-project/src/cmd/httpport' arguments: '-ldflags="-s -w" -o $(Build.BinariesDirectory)/bombastic'- task: ArchiveFiles@2 displayName: 'Archiving binaries ... ??????' inputs: rootFolderOrFile: '$(Build.BinariesDirectory)' includeRootFolder: false archiveType: 'zip' archiveFile: '$(Build.ArtifactStagingDirectory)/$(Build.BuildId).zip' replaceExistingArchive: true - task: PublishBuildArtifacts@1 displayName: 'publishing build artifacts' inputs: PathtoPublish: '$(Build.ArtifactStagingDirectory)' ArtifactName: 'drop' publishLocation: 'Container' replaceExistingArchive: true我下載已發(fā)布的工件,解壓縮并在本地運行它沒有問題。我使用項目創(chuàng)建了一個版本(Azure 管道中的功能發(fā)布),并將該項目推送到 azure 函數(shù)自定義處理程序。我去檢查azure函數(shù)應(yīng)用程序文件,結(jié)構(gòu)是夸張/夸張的夸張,是函數(shù)的名稱,/bombastic是Linux可執(zhí)行文件,通常你可以通過./bombastic調(diào)用。這是主機(jī)文件{ "version": "2.0", "logging": { "logLevel": { "default": "Trace" }, "applicationInsights": { "samplingSettings": { "isEnabled": true } } }, "extensionBundle": { "id": "Microsoft.Azure.Functions.ExtensionBundle", "version": "[1.*, 2.0.0)" }, "customHandler": { "description": { "defaultExecutablePath": "bombasticv", "arguments": [] }, "enableForwardingHttpRequest": true }}當(dāng)我點擊函數(shù)URL時,我得到一個未找到的404。有關(guān)獲取 azure 函數(shù)自定義處理程序以使用 Azure 管道項目的任何幫助將不勝感激。
自定義處理程序 defaultExecutablePath from azure pipelin
慕田峪7331174
2022-08-15 16:38:59