本文介绍了Azure的Web应用程序(MVC 6)连续部署失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图建立连续部署从到位桶的Azure的Web应用程序。然而,部署失败,出现以下错误:

 命令:deploy.cmd
处理ASP.NET 5 Web应用程序的部署。
调用命令:在参数'建筑'无法验证的说法。该
参数未定义不属于集合,86,64,臂的规定
在ValidateSet属性。供应一种说法认为是集合,然后尝试
再次该命令。
在C:\\ Program Files文件
(86)\\ SiteExtensions \\捻\\ 49.41216.1976 \\ BIN \\脚本\\ dnvm.ps1:1914年焦炭:9
+调用命令([脚本块] ::创建(dnvm- $ CMD $ cmdargs))
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~
+ CategoryInfo:InvalidData:(:) [调用命令],ParameterBindingValidationException
+ FullyQualifiedErrorId:ParameterArgumentValidationError,Microsoft.P​​ower
失败退出code = 1,命令= PowerShell的-NoProfile -nologo -ExecutionPolicy
无限制-Command
[System.Threading.Thread] :: CurrentThread.CurrentCulture ='';
[System.Threading.Thread] :: CurrentThread.CurrentUICulture =''; $ CmdPathFile ='D:\\本地\\用户配置\\ .dnx \\ TEMP-设置envvars.cmd';&安培;
C:\\ Program Files文件(x86)的\\ SiteExtensions \\捻\\ 49.41216.1976 \\ BIN \\脚本\\ dnvm.ps1'安装未定义-arch未定义-r未定义
Shell.Commands.InvokeCommandCommand网站在部署过程中出现了错误。

在Visual Studio中没有任何问题发布/直接部署2015年工作。这似乎是dnvm.ps1命令传递一堆导致此错误未定义的论点。创建本地部署脚本(运行为这里)指示

 蔚蓝网站deploymentscript --aspNet5<路径project.json文件>

也将产生同样具有未定义变量deploy.cmd。

我不使用任何自定义部署脚本和我global.json如下:

  {
  工程:SRC,测试],
  SDK:{
    版本:1.0.0-RC1-UPDATE1
  }
}


解决方案

发生这个问题,因为我已经跑蔚蓝网站deploymentscript --aspNet5<路径project.json文件> 在本地生成的 deploy.cmd 的文件。然后,该文件所使用的Azure的部署,如果它的存在。当地的 deploy.cmd 的有因的错误未定义的参数。取出的 deploy.cmd 的解决了这个问题。

I'm trying to set up continous deployment for an Azure Web App from Bitbucket. The deployment however fails with the following error:

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.

The publish/deployment directly from Visual Studio 2015 works without any problems. It seems like the dnvm.ps1 command is passed a bunch of "undefined" arguments causing this error. Creating the deployment script locally (as instructed here) by running

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

will also generate the deploy.cmd with same "undefined" variables.

I'm not using any custom deployment scripts and my global.json looks like:

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

The problem occurred because I had run azure site deploymentscript --aspNet5 <path to the project.json file> that generates deploy.cmd file locally. That file is then used by the Azure deployment if it exists. The local deploy.cmd had undefined parameters due to a bug in the generator. Removing the deploy.cmd solved this issue.

这篇关于Azure的Web应用程序(MVC 6)连续部署失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-24 00:37