Azure / deployment-stacks

Contains Deployment Stacks CLI scripts and releases
MIT License
89 stars 7 forks source link

New-AzResourceGroupDeploymentStack with verbose or debug makes it interactive #141

Closed bijlm closed 9 months ago

bijlm commented 10 months ago

Describe the bug When I start a deployment from a Azure Devops pipeline with debug or verbose enabled the pipeline exits with 'PowerShell is in NonInteractive mode. Read and Prompt functionality is not available.'

To Reproduce Steps to reproduce the behavior:

  1. Create a Yaml pipeline in azure Devops. Create a step AzurePowerShell@5 with the cmdlet New-AzResourceGroupDeploymentStack
  2. provide the template and the parameter file that works locally: This is the way I provide my parameters thru splatting: $hashParameters = [ordered]@{ Name = '${{ variables.ResourceGroupName }}_KeyVault' ResourceGroupName = '${{ variables.ResourceGroupName }}' TemplateFile = $TemplateFile TemplateParameterFile = $parameterFileTmp DenySettingsMode = 'DenyWriteAndDelete' DeleteAll = $true Force = $true }

As soon as I add Verbose = $true or Debug = $true to the hashtable

  1. The pipeline exits without seemingly even to try to deploy with 'PowerShell is in NonInteractive mode. Read and Prompt functionality is not available.'
  2. Even locally I can try to start a

Expected behavior I would expect a debug or verbose output during the task. This is something useful in a New-AzResourceGroupDeployment task.

Repro Environment Host OS: Windows Powershell Version: 7.4.0 AzurePowerShell (5.231.0) Az.Resources 6.12.1 Az.Accounts 2.13.2

dantedallag commented 9 months ago

Hey @bijlm, for -Verbose, you could pass the -Force flag with the command and that should get rid of prompts. For -Debug, there is no way currently to not run that interactively.

What sorts of information are you trying to extract from the output that is only available in -Verbose or -Debug?

bijlm commented 9 months ago

Yes, you're right, I was sure I tried that... apparently not. Thanks.