【问题标题】:Azure Resource Group Error: A parameter cannot be found that matches parameter name 'EnvironmentName'Azure 资源组错误:找不到与参数名称“EnvironmentName”匹配的参数
【发布时间】:2017-05-18 13:29:12
【问题描述】:

我正在尝试按照this 教程使用 Visual Studio 2015 创建 Azure 资源组项目。但是当我部署时,结果是一个奇怪的错误:

[ERROR] Add-AzureRmAccount : A parameter cannot be found that matches parameter name 
[ERROR] 'EnvironmentName'.
[ERROR] At line:1 char:2379
[ERROR] + ... xmg' -AccountId 'myemail@outlook.com' -EnvironmentName 'AzureC ...
[ERROR] +                                                  ~~~~~~~~~~~~~~~~
[ERROR]     + CategoryInfo          : InvalidArgument: (:) [Add-AzureRmAccount], Param 
[ERROR]    eterBindingException
[ERROR]     + FullyQualifiedErrorId : NamedParameterNotFound,Microsoft.Azure.Commands. 
[ERROR]    Profile.AddAzureRMAccountCommand
[ERROR]  
[ERROR] Run Login-AzureRmAccount to login.

我更新了最新版本的 Azure SDK,但仍然出现同样的错误。请帮我解决这个问题。

【问题讨论】:

    标签: visual-studio powershell azure automated-deploy


    【解决方案1】:

    Azure PowerShell cmdlet 的 4.x 版本中有一个重大更改,短期修复是回滚到 3.8。

    如果您使用“Install-Module AzureRM”安装 cmdlet,则使用 -RequiredVersion 参数卸载并重新安装,例如

    Install-Module AzureRM -RequiredVersion 3.8.0 -Force -AllowClobber
    

    如果您通过 WebPI/MSI/AzureSDK install 安装了 cmdlet,则从控制面板卸载 Azure PowerShell 并从此处安装 3.8 版本:https://github.com/Azure/azure-powershell/releases/download/v3.8.0-April2017/azure-powershell.3.8.0.msi

    我们正在修复 4.x...

    【讨论】:

    • 已将修复程序部署到 4.0.2 版本的 cmdlet - 您不再需要安装较旧的 3.8 版本 - 只需确保您拥有 4.0.2 而不是 4.0 或 4.0.1 .
    猜你喜欢
    • 2019-04-04
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多