I am trying to log in to my private ACR using the azure DevOps pipeline. I tried to do it this way:
- task: AzureCLI@2
  inputs:
    azureSubscription: $(azureSubscriptionForACR)
    scriptType: 'ps'
    scriptLocation: 'inlineScript'
    inlineScript: |
      $password = az acr credential show -n $(azureAcrName) --query passwords[0].value
      helm registry login $(azureContainerRegistry) --username $(azureAcrUserName) --password $password
which works, but there is a warning when I run the pipeline:
"WARNING: Using --password via the CLI is insecure. Use --password-stdin."
I would like to avoid the warning, so I tried many variants of this, but didn't  get the result as expected
- task: AzureCLI@2
  inputs:
    azureSubscription: $(azureSubscriptionForACR)
    scriptType: 'ps'
    scriptLocation: 'inlineScript'
    inlineScript: |
      $password = az acr credential show -n $(azureAcrName) --query passwords[0].value
      echo $password | helm registry login $(azureContainerRegistry) --username $(azureAcrName) --password-stdin
It always ends up with:
Error: Get "https://azureacr.azurecr.io/v2/": unauthorized: authentication required, visit https://aka.ms/acr/authorization for more information.
I am using the new helm 3.8.0 is there a way to do it with --password-stdin?