azure - 错误 - 访问被拒绝 - 部署到 Azure 应用服务

标签 azure asp.net-core deployment azure-web-app-service kudu

我们通过 KUDU 脚本在 Azure 中使用自动部署过程,今天我们在 Azure 部署中心看到奇怪的错误:

命令dotnetpublish(以及“dotnetbuild”)返回:

MSBUILD : error MSB1025: An internal failure occurred while running MSBuild.
Unhandled exception. System.ComponentModel.Win32Exception (5): Access is denied.
System.ComponentModel.Win32Exception (5): Access is denied.
   at System.Diagnostics.Process.set_PriorityClassCore(ProcessPriorityClass value)
   at System.Diagnostics.Process.set_PriorityClass(ProcessPriorityClass value)
   at Microsoft.Build.CommandLine.MSBuildApp.Execute(String[] commandLine)
   at Microsoft.Build.CommandLine.MSBuildApp.Main(String[] args)
   at System.Diagnostics.Process.set_PriorityClassCore(ProcessPriorityClass value)
   at System.Diagnostics.Process.set_PriorityClass(ProcessPriorityClass value)
   at Microsoft.Build.CommandLine.MSBuildApp.Execute(String[] commandLine)
Failed exitCode=-532462766, command=dotnet publish "D:\home\site\repository\
...

详细信息:

  • KUDU 脚本有自动部署过程
  • app 是 .NET Core 应用程序,.csproj 具有目标框架:netcoreapp2.2

问题可能会出现在 Azure 方面,因为我们没有在项目中进行任何更大的更改。 有没有人有相同/类似的问题?

最佳答案

我们遇到了同样的问题,经过调查我们发现:

  • Azure 应用了新的“dotnet”版本 3.1.301,此版本的 SDK 会引发该错误(您可以通过 commnad“dotnet --version”检查您的版本)
  • 通过命令“dotnet --list-sdks”您可以查看所有已安装的 SDK
  • 然后我们简单地使用以前的版本(在我们的例子中为 v3.1.202)
  • 判断 dotnet sdk 确切版本的最简单方法是通过 global.json

示例: 全局.json

{
  "sdk": {
    "version": "3.1.202"
  }
}

文件必须位于“工作目录”中,并且 KUDU 脚本在此处具有工作目录 D:\home\site\repository

当您的部署在以前版本的 dotnet SDK 上正常时,这肯定会有所帮助。

关于azure - 错误 - 访问被拒绝 - 部署到 Azure 应用服务,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/62595408/

相关文章:

azure - KQL 专用端点字节输入\输出

azure - ARM模板部署的功能应用程序没有主机 key 并引发错误

python - 为桌面环境分发 Docker 容器应用程序

django - Heroku Django-Admin 500 错误?

.net - 如何将对本地创建的非 ASP.Net 5 dll 的引用添加到 ASP.Net 5 项目

tomcat - AWS 服务器中的部署自动化

powershell - 删除 AzureDisk 抛出错误,不知道为什么

c# - 使用 C# 的公钥验证 JWT

azure - 是否有适用于 .NETStandard 1.5 的 Azure 存储库?

asp.net-core - dnu 发布,进程无法访问该文件