构建管道在 Azure Functions 的发布级别不断崩溃
Build Pipeline keep crashing at Publish level of Azure Functions
我正在尝试使用 Devops 管道构建和部署 Azure Functions (CI)
这些是我的步骤
但是直到步骤 Publish 执行的所有内容都没有任何错误。但是在发布级别我收到此错误(如上图所示)
Active code page: 65001
Info: .NET Core SDK/runtime 2.2 and 3.0 are now End of Life(EOL) and have been removed from all hosted agents. If you're using these SDK/runtimes on hosted agents, kindly upgrade to newer versions which are not EOL, or else use UseDotNet task to install the required version.
Info: Azure Pipelines hosted agents have been updated and now contain .Net 5.x SDK/Runtime along with the older .Net Core version which are currently lts. Unless you have locked down a SDK version for your project(s), 5.x SDK might be picked up which might have breaking behavior as compared to previous versions. You can learn more about the breaking changes here: https://docs.microsoft.com/en-us/dotnet/core/tools/ and https://docs.microsoft.com/en-us/dotnet/core/compatibility/ . To learn about more such changes and troubleshoot, refer here: https://docs.microsoft.com/en-us/azure/devops/pipelines/tasks/build/dotnet-core-cli?view=azure-devops#troubleshooting
##[error]Project file(s) matching the specified pattern were not found.
Finishing: Publish
我认为是因为 .Net 版本,所以我在发布之前添加了使用 .NET 5.x 步骤。但它仍然触发相同的错误。
这是这3个步骤的Yaml
steps:
- task: DotNetCoreCLI@2 displayName: 'dotnet build' inputs:
projects: 'Toolset/ScheduledJobs/*.csproj'
steps:
- task: UseDotNet@2 displayName: 'Use .NET Core sdk 5.x' inputs:
version: 5.x
steps:
- task: DotNetCoreCLI@2 displayName: Publish inputs:
command: publish
publishWebProjects: false
projects: '--configuration $(BuildConfiguration) --output $(Build.ArtifactStagingdirectory)/ScheduledJobs'
zipAfterPublish: false
modifyOutputPath: false
请告诉我哪里做错了?
我在 VS 2019 中开发了 Azure Function (3.0)
发布时需要提供项目路径,如下所示:
- task: DotNetCoreCLI@2
inputs:
command: 'publish'
publishWebProjects: true
projects: 'BlazorSample.csproj'
arguments: '--configuration $(buildConfiguration) --output $(build.artifactstagingdirectory)"'
zipAfterPublish: false
workingDirectory: $(Build.SourcesDirectory)/Whosebug/51-blazor-sample/BlazorSample
请注意最后的working directory
。
同时更改您的订单
- task: UseDotNet@2 displayName: 'Use .NET Core sdk 5.x' inputs:
version: 5.x
在此之前:
- task: DotNetCoreCLI@2 displayName: 'dotnet build' inputs:
projects: 'Toolset/ScheduledJobs/*.csproj'
我正在尝试使用 Devops 管道构建和部署 Azure Functions (CI)
这些是我的步骤
但是直到步骤 Publish 执行的所有内容都没有任何错误。但是在发布级别我收到此错误(如上图所示)
Active code page: 65001
Info: .NET Core SDK/runtime 2.2 and 3.0 are now End of Life(EOL) and have been removed from all hosted agents. If you're using these SDK/runtimes on hosted agents, kindly upgrade to newer versions which are not EOL, or else use UseDotNet task to install the required version.
Info: Azure Pipelines hosted agents have been updated and now contain .Net 5.x SDK/Runtime along with the older .Net Core version which are currently lts. Unless you have locked down a SDK version for your project(s), 5.x SDK might be picked up which might have breaking behavior as compared to previous versions. You can learn more about the breaking changes here: https://docs.microsoft.com/en-us/dotnet/core/tools/ and https://docs.microsoft.com/en-us/dotnet/core/compatibility/ . To learn about more such changes and troubleshoot, refer here: https://docs.microsoft.com/en-us/azure/devops/pipelines/tasks/build/dotnet-core-cli?view=azure-devops#troubleshooting
##[error]Project file(s) matching the specified pattern were not found.
Finishing: Publish
我认为是因为 .Net 版本,所以我在发布之前添加了使用 .NET 5.x 步骤。但它仍然触发相同的错误。
这是这3个步骤的Yaml
steps:
- task: DotNetCoreCLI@2 displayName: 'dotnet build' inputs:
projects: 'Toolset/ScheduledJobs/*.csproj'
steps:
- task: UseDotNet@2 displayName: 'Use .NET Core sdk 5.x' inputs:
version: 5.x
steps:
- task: DotNetCoreCLI@2 displayName: Publish inputs:
command: publish
publishWebProjects: false
projects: '--configuration $(BuildConfiguration) --output $(Build.ArtifactStagingdirectory)/ScheduledJobs'
zipAfterPublish: false
modifyOutputPath: false
请告诉我哪里做错了?
我在 VS 2019 中开发了 Azure Function (3.0)
发布时需要提供项目路径,如下所示:
- task: DotNetCoreCLI@2
inputs:
command: 'publish'
publishWebProjects: true
projects: 'BlazorSample.csproj'
arguments: '--configuration $(buildConfiguration) --output $(build.artifactstagingdirectory)"'
zipAfterPublish: false
workingDirectory: $(Build.SourcesDirectory)/Whosebug/51-blazor-sample/BlazorSample
请注意最后的working directory
。
同时更改您的订单
- task: UseDotNet@2 displayName: 'Use .NET Core sdk 5.x' inputs:
version: 5.x
在此之前:
- task: DotNetCoreCLI@2 displayName: 'dotnet build' inputs:
projects: 'Toolset/ScheduledJobs/*.csproj'