Azure Powershell step az login

We recently upgraded our octopus deploy instance, ever since I am getting an error on the beginning of every azure powershell script.

ERROR: az login: error: argument --password/-p: expected one argument

I had assumed this was a az cli issue, but it appears az --version works ok, and the fact i am getting this error seems to indicate the cli is installed and working.

Our service principle is also working correctly as deployment steps dont fail. I am really close to reverting back to non az cli scripts at this point.

Any ideas, or directions I can explore?

Hi Shaun,

Thanks for reaching out. Sorry to hear you’re getting these errors in the log, I’ve had a look through and can’t see any recent changes that stand out as possible causes.

Could I check which version you upgraded from and to? Could I also get you to check the value of the password you are using? The wording on the error makes me wonder if there is some unusual character in the password that is somehow causing it to split the arguments to the login call.

Regards
Shannon

Hi Shannon,

Perfect, looks like you were bang on with the password having character issues. Regenerated and everything working great now.

Thanks for the quick, solid response!

Regards

Shaun

Hi Shannon,

Just for reference, do you have any resources regarding the character’s no accepted. I just want to be able to confirm which characters will cause this problem going forward?

Thanks

Shaun

Unfortunately I don’t know exactly what characters would cause this. Our Calamari code is open source, you can see the login script here. The functions it’s using come from our bootstrapper. If I had to guess I’d suspect quotes, but it does look like those methods should be handling that.

Regards
Shannon

Actually I just spoke with another team member who said there have been issues with # and $, given they have meaning to PowerShell.

Regards
Shannon