Recently, if you have been trying to deploy Azure Resource Group template using Visual Studio, you might see below error:
[ERROR] Add-AzureRmAccount : A parameter cannot be found that matches parameter name
[ERROR] 'EnvironmentName'.
[ERROR] At line:1 char:2379
[ERROR] + ... xmg' -AccountId 'myemail@gmail.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.
There was a breaking change in the 4.x release of the Azure PowerShell cmdlets, the short term fix is to roll back to 3.8.
If you have used “Install-Module AzureRM” to install the cmdlets, then uninstall and re-install with the -RequiredVersion parameter, e.g.
Install-Module AzureRM -RequiredVersion 3.8.0 -Force -AllowClobber
If you installed the cmdlets via WebPI/MSI/AzureSDK install, then uninstall Azure PowerShell from control panel and install the 3.8 version from https://github.com/Azure/azure-powershell/releases/download/v3.8.0-April2017/azure-powershell.3.8.0.msi
Meanwhile, Microsoft is working on a fix.