Update-AzureRmVmss:缺少必需参数 'adminPassword'(空)
Update-AzureRmVmss : Required parameter 'adminPassword' is missing (null)
我正在尝试 运行 规模集上的 PowerShell vmss 自定义扩展脚本。
我在尝试 运行 Update-AzureRmVmss 命令时收到此错误
Update-AzureRmVmss:缺少必需参数 'adminPassword'(空)。
错误代码:无效参数
错误消息:缺少必需参数 'adminPassword'(空)。
状态码:400
ReasonPhrase:请求错误
$customConfig = @{
"fileUris" = @("https://$storageAccountName.blob.core.windows.net/scripts/script.ps1");
"commandToExecute" = "PowerShell -ExecutionPolicy Unrestricted .\script.ps1";
};
# Add the extension to the config
$vmss = Get-AzureRmVmss -ResourceGroupName $resourceGroup -VMScaleSetName $vmssname
Add-AzureRmVmssExtension -VirtualMachineScaleSet $vmss -Publisher Microsoft.Compute -Type CustomScriptExtension -TypeHandlerVersion 2.0 -Name "runscript" -Setting $customConfig
# Send the new config to Azure
Update-AzureRmVmss -ResourceGroupName $resourceGroup -Name "runscript" -VirtualMachineScaleSet $vmss
我想通了。
-Name 需要是规模集名称。我从网上得到的代码的名称是错误的脚本名称。
Update-AzureRmVmss -ResourceGroupName $resourceGroup -Name "scalsetname" -VirtualMachineScaleSet $vmss
使用 PowerShell cmdlet 或 CLI 命令直接添加扩展可能更容易..
电源Shell:添加-AzureRmVmssExtension
CLI:az vmss 扩展集
Azure Cloud Shell 具有内置的经过身份验证的 CLI 版本。
Update-AzureRmVmss 的正确参数是 -VMScaleSetName,它还有一个名为 Name 的别名。
我也使用 -Name 参数得到同样的错误,
但是当我尝试使用 -VMScaleSetName
代替 -Name
时,我没有看到错误。
Update-AzureRmVmss -ResourceGroupName $resourceGroup -VMScaleSetName "scalesetname" -VirtualMachineScaleSet $vmss
我正在尝试 运行 规模集上的 PowerShell vmss 自定义扩展脚本。
我在尝试 运行 Update-AzureRmVmss 命令时收到此错误 Update-AzureRmVmss:缺少必需参数 'adminPassword'(空)。 错误代码:无效参数 错误消息:缺少必需参数 'adminPassword'(空)。 状态码:400 ReasonPhrase:请求错误
$customConfig = @{
"fileUris" = @("https://$storageAccountName.blob.core.windows.net/scripts/script.ps1");
"commandToExecute" = "PowerShell -ExecutionPolicy Unrestricted .\script.ps1";
};
# Add the extension to the config
$vmss = Get-AzureRmVmss -ResourceGroupName $resourceGroup -VMScaleSetName $vmssname
Add-AzureRmVmssExtension -VirtualMachineScaleSet $vmss -Publisher Microsoft.Compute -Type CustomScriptExtension -TypeHandlerVersion 2.0 -Name "runscript" -Setting $customConfig
# Send the new config to Azure
Update-AzureRmVmss -ResourceGroupName $resourceGroup -Name "runscript" -VirtualMachineScaleSet $vmss
我想通了。 -Name 需要是规模集名称。我从网上得到的代码的名称是错误的脚本名称。
Update-AzureRmVmss -ResourceGroupName $resourceGroup -Name "scalsetname" -VirtualMachineScaleSet $vmss
使用 PowerShell cmdlet 或 CLI 命令直接添加扩展可能更容易..
电源Shell:添加-AzureRmVmssExtension CLI:az vmss 扩展集
Azure Cloud Shell 具有内置的经过身份验证的 CLI 版本。
Update-AzureRmVmss 的正确参数是 -VMScaleSetName,它还有一个名为 Name 的别名。
我也使用 -Name 参数得到同样的错误,
但是当我尝试使用 -VMScaleSetName
代替 -Name
时,我没有看到错误。
Update-AzureRmVmss -ResourceGroupName $resourceGroup -VMScaleSetName "scalesetname" -VirtualMachineScaleSet $vmss