microsoft / azure_arc

Automated Azure Arc, Edge, and Platform environments
https://aka.ms/ArcJumpstart
Creative Commons Attribution 4.0 International
744 stars 550 forks source link

A parameter cannot be found that matches parameter name 'AsPlainText'. #2620

Closed kumar241982 closed 4 months ago

kumar241982 commented 4 months ago

Hello Team,

I followed the steps as documented in the article :

https://azurearcjumpstart.com/azure_jumpstart_hcibox/deployment_azd

Then once i logged in the HCI-Client VM the script started to execute but it failed at

INFO: Loaded Module 'Az.Accounts' INFO: Loaded Module 'Az.ConnectedMachine'

TerminatingError(): "The running command stopped because the preference variable "ErrorActionPreference" or common parameter is set to Stop: A parameter cannot be found that matches parameter name 'AsPlainText'." TerminatingError(): "The running command stopped because the preference variable "ErrorActionPreference" or common parameter is set to Stop: A parameter cannot be found that matches parameter name 'AsPlainText'." TerminatingError(): "The running command stopped because the preference variable "ErrorActionPreference" or common parameter is set to Stop: A parameter cannot be found that matches parameter name 'AsPlainText'." TerminatingError(): "The running command stopped because the preference variable "ErrorActionPreference" or common parameter is set to Stop: A parameter cannot be found that matches parameter name 'AsPlainText'." TerminatingError(): "The running command stopped because the preference variable "ErrorActionPreference" or common parameter is set to Stop: A parameter cannot be found that matches parameter name 'AsPlainText'." The running command stopped because the preference variable "ErrorActionPreference" or common parameter is set to Stop: A parameter cannot be found that matches parameter name 'AsPlainText'. A parameter cannot be found that matches parameter name 'AsPlainText'. At C:\HCIBox\New-HCIBoxCluster.ps1:1443 char:9

  • Invoke-Command -VMName $node.Hostname -Credential $localCred ...
  • CategoryInfo : InvalidArgument: (:) [ConvertFrom-SecureString], ParameterBindingException
  • FullyQualifiedErrorId : NamedParameterNotFound,Microsoft.PowerShell.Commands.ConvertFromSecureStringCommand
  • PSComputerName : AzSHOST1

How can we fix this up and continue from where we stopped.

janegilring commented 4 months ago

Here is a temporary workaround:

cd path/to/your/local/azure_arc/repository/clone
git fetch --all
git checkout b36535ab63850d9d5e192831d74f5e22ed75b261

To revert after deployment or when you want to use latest version again: git checkout main

When triggering the deployment, specify the same commit id for the parameter githubBranch:

$rgname = "hcibox-rg"
New-AzResourceGroup -Name $RGname -Location "northeurope"

$TemplateFile = "C:\repos\azure_arc\azure_jumpstart_hcibox\bicep\main.bicep"
$TemplateParameterFile = "C:\repos\azure_arc\azure_jumpstart_hcibox\bicep\hcibox.parameters.json"

$githubAccount = "microsoft"
$githubBranch = "b36535ab63850d9d5e192831d74f5e22ed75b261"

New-AzResourceGroupDeployment -Name hcibox -ResourceGroupName $RGname -githubAccount $githubAccount -githubBranch $githubBranch -TemplateFile $TemplateFile -TemplateParameterFile $TemplateParameterFile