Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Azure CLI: az devops configure --defaults... has no effect. What am I missing?

I am using Azure CLI azure-devops extension to manage my projects and git repositories in dev.azure.com.

az extension add --name azure-devops

To make code more readable and configurable I would like to use: (it does not matter if the values are between quotation marks or not)

az devops configure --defaults organization=https://dev.azure.com/myname
az devops configure --defaults project=f514a982-...  

Those commands executed without error (powershell) but it seems they has no effect on the following commands.

For example

az repos list # lists an other project's repos, not the required f514a982

However executing

az repos list --project f514a982....

gives the expected result.

Missing I something or is this a bug?

like image 438
g.pickardou Avatar asked Sep 05 '25 05:09

g.pickardou


1 Answers

Actually I figured it out, hopefully spares time someone in the future:

There is a --detect parameter which is on by default and if it is on then overrules the --defaults settings.

So if you run anywhere the command under a git repo folder tree and you do not explicitly use the --detect off, it will use that devops project (as default) which that git repo belongs to regardless of the previously executed az devops configure --defaults command

like image 93
g.pickardou Avatar answered Sep 07 '25 20:09

g.pickardou