Skip to content

New-AzBlockchainMember has issue when running it in a Linux environment #12707

@dingmeng-xue

Description

@dingmeng-xue

Description

It seems password in PUT request is different from user's input. This issue can be reproduced on Linux or CloudShell.

Steps to reproduce

[int]$timeInt = $(Get-Date -UFormat '%s')
$Name = "bcmember$timeInt"
$resourceGroupName = 'myResourceGroup'
$location = 'eastus'
$Consortium = "consortium$timeInt"
$Sku = 'S0'

if (-not(Get-InstalledModule -Name Az -ErrorAction SilentlyContinue)) {
    Install-Module -Name Az -Force
}
if (-not(Get-InstalledModule -Name Az.Blockchain -ErrorAction SilentlyContinue)){
    Install-Module -Name Az.Blockchain -Force
}
if ((Get-AzResourceProvider -ProviderNamespace Microsoft.Blockchain).RegistrationState -contains 'NotRegistered'){
    Register-AzResourceProvider -ProviderNamespace Microsoft.Blockchain
}
if (-not(Get-AzResourceGroup -Name $resourceGroupName -ErrorAction SilentlyContinue)){
  New-AzResourceGroup -Name $resourceGroupName -Location $location
}

$passwd = "bl0ckCh@!n$timeInt)" | ConvertTo-SecureString -AsPlainText -Force
$csPasswd = "C0n`$0rt!um$timeInt" | ConvertTo-SecureString -AsPlainText -Force

$memberParams = @{
  Name = $Name
  ResourceGroupName = $resourceGroupName
  Consortium = $Consortium
  ConsortiumManagementAccountPassword = $csPasswd
  Location = $location
  Password = $passwd
  Protocol = 'Quorum'
  Sku = $Sku
}
New-AzBlockchainMember @memberParams
DEBUG: ============================ HTTP REQUEST ============================

HTTP Method:
PUT

Absolute Uri:
https://management.azure.com/subscriptions/bb881e62-cf77-4d5d-89fb-29d71e930b66/resourceGroups/mirobb-rg/providers/Microsoft.Blockchain/blockchainMembers/bcmember1597871819?api-version=2018-06-01-preview

Headers:

Body:
{
  "location": "eastus",
  "properties": {
    "consortium": "consortium1597871819",
    "consortiumManagementAccountPassword": "C",
    "password": "b",
    "protocol": "Quorum"
  },
  "sku": {
    "name": "S0"
  }
}


DEBUG: BeforeCall:
DEBUG: ============================ HTTP RESPONSE ============================

Status Code:
BadRequest

Headers:
Cache-Control                 : no-cache
Pragma                        : no-cache
x-ms-ratelimit-remaining-subscription-writes: 1198
X-Content-Type-Options        : nosniff
Strict-Transport-Security     : max-age=31536000; includeSubDomains
Server                        : Kestrel
x-ms-request-id               : 76b3fa9c-56a6-407d-b30e-9ae1935c7220
x-ms-correlation-request-id   : 76b3fa9c-56a6-407d-b30e-9ae1935c7220
x-ms-routing-request-id       : SOUTHCENTRALUS:20200819T211915Z:76b3fa9c-56a6-407d-b30e-9ae1935c7220
Date                          : Wed, 19 Aug 2020 21:19:15 GMT

Body:
Invalid blockchain member payload: password length out of range. The value must be at least 12 characters and no more than 72 characters in length.


DEBUG: ResponseCreated:
DEBUG: Finally:
New-AzBlockchainMember_CreateExpanded: /home/mike/.local/share/powershell/Modules/Az.Blockchain/0.1.0/custom/New-AzBlockchainMember.ps1:200
Line |
200 |          Az.Blockchain.internal\New-AzBlockchainMember @PSBoundParamet …
     |          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     | The server responded with a Request Error, Status: BadRequest

DEBUG: [CmdletProcessRecordAsyncEnd]: Sending new QosEvent for command 'New-AzBlockchainMember_CreateExpanded': AzureQoSEvent: CommandName - New-AzBlockchainMember_CreateExpanded; IsSuccess - True; Duration - 00:00:00;
DEBUG: CmdletProcessRecordAsyncEnd:
DEBUG: CmdletProcessRecordEnd:
DEBUG: CmdletEndProcessing:

Environment data


Module versions

Debug output


Error output


Metadata

Metadata

Assignees

Labels

Azure PS TeamBlockChainbugThis issue requires a change to an existing behavior in the product in order to be resolved.

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions