繁体   English   中英

Azure Web App(MVC 6)持续部署失败

[英]Azure Web App (MVC 6) continuous deployment fails

我正在尝试从Bitbucket为Azure Web App设置连续部署。 但是部署失败,出现以下错误:

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\49.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\49.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发布/部署工作没有任何问题。 似乎dnvm.ps1命令传递了一堆“未定义”参数导致此错误。 通过运行本地创建部署脚本( 如此处所述

azure site deploymentscript --aspNet5 <path to the project.json file>

还将生成具有相同“未定义”变量的deploy.cmd。

我没有使用任何自定义部署脚本,我的global.json看起来像:

{
  "projects": [ "src", "test" ],
  "sdk": {
    "version": "1.0.0-rc1-update1"
  }
}

出现问题的原因是我运行了azure site deploymentscript --aspNet5 <path to the project.json file> ,它在本地生成deploy.cmd文件。 然后Azure部署使用该文件(如果存在)。 由于生成器中的错误,本地deploy.cmd具有未定义的参数。 删除deploy.cmd解决了这个问题。

在重新运行部署脚本生成器时,我最终必须将这些显式指定为参数。

azure site deploymentscript --aspNet5 sr\\[myprojectfolder]\\ --aspNet5Version 1.0.0-rc1-update1 --aspNet5Architecture x64 --aspNet5Runtime CLR

正如automatonic建议的那样首先在global.json中指定它们然后重新运行没有任何效果,我认为这是一个bug。

您的global.json文件可以定义runtimearchitecture

{
  "projects": [ "src", "test" ],
  "sdk": {
    "version": "1.0.0-rc1-update1",
    "runtime": "clr",
    "architecture": "x64"
  }
}

我猜这些脚本是从这些值中提取出来的,并且不知道如何应对global.json中缺少的那些?

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM