【发布时间】:2023-02-11 04:40:55
【问题描述】:
我正在尝试将新创建的 Azure Function 部署到 Linux Azure Function 应用程序。出于某种原因,这一直失败,即使功能和应用程序是新创建的。我试过使用 azure cli、VS Code 和 Github Actions,但总是失败。当我将相同的功能部署到 Windows Functions 应用程序时,一切都很顺利。下面是错误输出:
Successfully parsed SCM credential from publish-profile format.
Using SCM credential for authentication, GitHub Action will not perform resource validation.
Successfully acquired app settings from function app (with SCM credential)!
Will archive . into /home/runner/work/_temp/temp_web_package_2443264159027716.zip as function app content
Will use Kudu https:///api/zipdeploy to deploy since publish-profile is detected.
Setting SCM_DO_BUILD_DURING_DEPLOYMENT in Kudu container to true
Update using Client.updateAppSettingViaKudu
Response with status code 204
App setting SCM_DO_BUILD_DURING_DEPLOYMENT propagated to Kudu container
Setting ENABLE_ORYX_BUILD in Kudu container to false
Update using Client.updateAppSettingViaKudu
Response with status code 204
App setting ENABLE_ORYX_BUILD propagated to Kudu container
Package deployment using ZIP Deploy initiated.
Updating submodules.
Preparing deployment for commit id '00497852-0'.
PreDeployment: context.CleanOutputPath False
PreDeployment: context.OutputPath /home/site/wwwroot
Repository path is /tmp/zipdeploy/extracted
Running oryx build...
Command: oryx build /tmp/zipdeploy/extracted -o /home/site/wwwroot --platform nodejs --platform-version ~16
Operation performed by Microsoft Oryx, https://github.com/Microsoft/Oryx
You can report issues at https://github.com/Microsoft/Oryx/issues
Oryx Version: 0.2.20210120.1, Commit: 66c7820d7df527aaffabd2563a49ad57930999c9, ReleaseTagName: 20210120.1
Build Operation ID: |fobbjx9Jh14=.7ba5fe28_
Repository Commit : 00497852-0566-46df-b53b-a3eec6c1e567
Detecting platforms...
Detected following platforms:
nodejs: 16.14.2
Source directory : /tmp/zipdeploy/extracted
Destination directory: /home/site/wwwroot
Using Node version:
v16.14.2
Using Npm version:
8.5.0
Running 'npm install --unsafe-perm'...
up to date, audited 129 packages in 896ms
9 packages are looking for funding
run npm fund for details
found 0 vulnerabilities
Running 'npm run build'...
leadsbeasts@1.0.0 build
tsc
/tmp/zipdeploy/extracted/node_modules/.bin/tsc: 1: /tmp/zipdeploy/extracted/node_modules/.bin/tsc: ../typescript/bin/tsc: not found
/tmp/zipdeploy/extracted/node_modules/.bin/tsc: 1: /tmp/zipdeploy/extracted/node_modules/.bin/tsc: ../typescript/bin/tsc: not found\n/opt/Kudu/Scripts/starter.sh oryx build /tmp/zipdeploy/extracted -o /home/site/wwwroot --platform nodejs --platform-version ~16
Generating summary of Oryx build
Deployment Log file does not exist in /tmp/oryx-build.log
The logfile at /tmp/oryx-build.log is empty. Unable to fetch the summary of build
Deployment Failed. deployer = GITHUB_ZIP_DEPLOY deploymentPath = Functions App ZipDeploy. Extract zip. Remote build.
Error: Failed to deploy web package to App Service.
Error: Execution Exception (state: PublishContent) (step: Invocation)
Error: When request Azure resource at PublishContent, zipDeploy : Failed to use /home/runner/work/temp/temp_web_package2443264159027716.zip as ZipDeploy content
Error: Package deployment using ZIP Deploy failed. Refer logs for more details.
Error: Deployment Failed!
有谁知道如何解决这一问题?我需要确保我的应用程序是在服务器上构建的,据我所知,使用 Windows 操作系统是不可能的。这是这个设置:“azureFunctions.scmDoBuildDuringDeployment”:true
【问题讨论】:
标签: node.js linux azure azure-functions