Why does certain Azure CLI commands require az login


In our VSTS release pipeline we want to call a powershell script that adds a function key for one of my Azure Functions (using the Key Management rest API).

I’ve created a script based on this article:

Works locally, but when running it VSTS it gets and error when calling

with the message:

ERROR: Please run ‘az login’ to setup account.

We have other azure cli calls that works, ex: az cosmosdb database, so I guess our Service Principle connections are in place. What could be the issue here?


Seems like we had an old powershell version containing a bug that keeps the old service connection authentication context when you create a new service connection authentication, which I did in this case.

So we updated powershell on our build agents and we got things going!


Why does certain Azure CLI commands require az login by licensed under CC BY-SA | With most appropriate answer!

Leave a Reply