jason-johnson / azure-pipelines-tasks-terraform

Azure Pipelines extension for Terraform
MIT License
121 stars 52 forks source link

Use -p=secret for azcli login #373

Closed rubensprt closed 8 months ago

rubensprt commented 9 months ago

Solves the 'unlucky lottery' Azure CLI login issue when the client secret of service principal happens to start with a '-'.

Azure cli throws the following error when the secret start with a dash:

Log in with a service principal using client secret. Use -p=secret if the first character of the password is '-'.

This change simply updates the password argument in the az login command to use -p=<secret> instead of -p <secret>

jason-johnson commented 9 months ago

Hi, thanks for this. Right now it seems to be failing in the build pipeline. I need to figure out why before I can accept it.

Aschwinx commented 9 months ago

Would be great if this problem can be solved, nothing more frustrating then a broken pipeline on crucial moments.

jason-johnson commented 8 months ago

Hi @rubensprt, could you merge with the latest master? That will let the tests run so I can verify if this code broke anything (it shouldn't have but Murphy's law, etc.)

rubensprt commented 8 months ago

Ive merged main into the branch!

jason-johnson commented 8 months ago

Ok, sadly the tests still didn't run on my side but I've went ahead and merged anyway. You should see the changes show up under terraformCli@2 in the next few days.

jason-johnson commented 8 months ago

@rubensprt The PR seems to break the terraformCli tests. Did you run these locally before hand?