Azure Web App (MVC 6) 连续部署失败
Azure Web App (MVC 6) continuous deployment fails
我正在尝试为来自 Bitbucket 的 Azure Web 应用程序设置持续部署。但是,部署失败并出现以下错误:
Command: deploy.cmd
Handling ASP.NET 5 Web Application deployment.
Invoke-Command : Cannot validate argument on parameter 'Architecture'. The
argument "undefined" does not belong to the set ",x86,x64,arm" specified by
the ValidateSet attribute. Supply an argument that is in the set and then try
the command again.
At C:\Program Files
(x86)\SiteExtensions\Kudu.41216.1976\bin\scripts\dnvm.ps1:1914 char:9
+ Invoke-Command ([ScriptBlock]::Create("dnvm-$cmd $cmdargs"))
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidData: (:) [Invoke-Command], ParameterBindingValidationException
+ FullyQualifiedErrorId : ParameterArgumentValidationError,Microsoft.Power
Failed exitCode=1, command=PowerShell -NoProfile -NoLogo -ExecutionPolicy
unrestricted -Command "
[System.Threading.Thread]::CurrentThread.CurrentCulture = '';
[System.Threading.Thread]::CurrentThread.CurrentUICulture = '';$CmdPathFile='"D:\local\UserProfile\.dnx\temp-set-envvars.cmd"';&
'C:\Program Files (x86)\SiteExtensions\Kudu.41216.1976\bin\scripts\dnvm.ps1' " install undefined -arch undefined -r undefined
Shell.Commands.InvokeCommandCommand
An error has occurred during web site deployment.
直接来自 Visual Studio 2015 的 publish/deployment 没有任何问题。似乎 dnvm.ps1 命令传递了一堆 "undefined" 参数导致此错误。通过 运行
在本地创建部署脚本 (as instructed here)
azure site deploymentscript --aspNet5 <path to the project.json file>
还将生成具有相同 "undefined" 变量的 deploy.cmd。
我没有使用任何自定义部署脚本,我的 global.json 看起来像:
{
"projects": [ "src", "test" ],
"sdk": {
"version": "1.0.0-rc1-update1"
}
}
您的 global.json 文件可以定义 runtime
和 architecture
:
{
"projects": [ "src", "test" ],
"sdk": {
"version": "1.0.0-rc1-update1",
"runtime": "clr",
"architecture": "x64"
}
}
我猜脚本是从这些值中提取出来的,但不知道如何处理 global.json 中缺少的值?
出现问题是因为我有 运行 azure site deploymentscript --aspNet5 <path to the project.json file>
在本地生成 deploy.cmd 文件。 Azure 部署随后会使用该文件(如果存在)。由于 ,本地 deploy.cmd 有未定义的参数。删除 deploy.cmd 解决了这个问题。
我最终不得不在 re-running 部署脚本生成器时将这些明确指定为参数。
azure site deploymentscript --aspNet5 sr\[myprojectfolder]\ --aspNet5Version 1.0.0-rc1-update1 --aspNet5Architecture x64 --aspNet5Runtime CLR
首先按照 automatonic 的建议在 global.json 中指定它们,然后 re-running 没有任何效果,我认为这是一个错误。
我正在尝试为来自 Bitbucket 的 Azure Web 应用程序设置持续部署。但是,部署失败并出现以下错误:
Command: deploy.cmd
Handling ASP.NET 5 Web Application deployment.
Invoke-Command : Cannot validate argument on parameter 'Architecture'. The
argument "undefined" does not belong to the set ",x86,x64,arm" specified by
the ValidateSet attribute. Supply an argument that is in the set and then try
the command again.
At C:\Program Files
(x86)\SiteExtensions\Kudu.41216.1976\bin\scripts\dnvm.ps1:1914 char:9
+ Invoke-Command ([ScriptBlock]::Create("dnvm-$cmd $cmdargs"))
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidData: (:) [Invoke-Command], ParameterBindingValidationException
+ FullyQualifiedErrorId : ParameterArgumentValidationError,Microsoft.Power
Failed exitCode=1, command=PowerShell -NoProfile -NoLogo -ExecutionPolicy
unrestricted -Command "
[System.Threading.Thread]::CurrentThread.CurrentCulture = '';
[System.Threading.Thread]::CurrentThread.CurrentUICulture = '';$CmdPathFile='"D:\local\UserProfile\.dnx\temp-set-envvars.cmd"';&
'C:\Program Files (x86)\SiteExtensions\Kudu.41216.1976\bin\scripts\dnvm.ps1' " install undefined -arch undefined -r undefined
Shell.Commands.InvokeCommandCommand
An error has occurred during web site deployment.
直接来自 Visual Studio 2015 的 publish/deployment 没有任何问题。似乎 dnvm.ps1 命令传递了一堆 "undefined" 参数导致此错误。通过 运行
在本地创建部署脚本 (as instructed here)azure site deploymentscript --aspNet5 <path to the project.json file>
还将生成具有相同 "undefined" 变量的 deploy.cmd。
我没有使用任何自定义部署脚本,我的 global.json 看起来像:
{
"projects": [ "src", "test" ],
"sdk": {
"version": "1.0.0-rc1-update1"
}
}
您的 global.json 文件可以定义 runtime
和 architecture
:
{
"projects": [ "src", "test" ],
"sdk": {
"version": "1.0.0-rc1-update1",
"runtime": "clr",
"architecture": "x64"
}
}
我猜脚本是从这些值中提取出来的,但不知道如何处理 global.json 中缺少的值?
出现问题是因为我有 运行 azure site deploymentscript --aspNet5 <path to the project.json file>
在本地生成 deploy.cmd 文件。 Azure 部署随后会使用该文件(如果存在)。由于
我最终不得不在 re-running 部署脚本生成器时将这些明确指定为参数。
azure site deploymentscript --aspNet5 sr\[myprojectfolder]\ --aspNet5Version 1.0.0-rc1-update1 --aspNet5Architecture x64 --aspNet5Runtime CLR
首先按照 automatonic 的建议在 global.json 中指定它们,然后 re-running 没有任何效果,我认为这是一个错误。