Describe the bug
When I use az devops configure --defaults organization=https://dev.azure.com/XXXX and then `az devops project list, I get projects from another organization.
To Reproduce
Azure Cli Version:
azure-cli 2.0.59
Azure-Devops extension version:
Use az --version
Look for something like-
Extensions:
azure-devops (0.3.0)
Steps to reproduce the behavior:
Expected behavior
I would expect to see the single project in organisatin ############ like I see in the GUI, not 3 projects from another Org
Screenshots
If applicable, add screenshots to help explain your problem.
Debug logs
```$ az devops project list --output table --debug
Command arguments: ['devops', 'project', 'list', '--output', 'table', '--debug']
Event: Cli.PreExecute []
Event: CommandParser.OnGlobalArgumentsCreate [
Event: CommandInvoker.OnPreCommandTableCreate []
Installed command modules ['acr', 'acs', 'advisor', 'ams', 'appservice', 'backup', 'batch', 'batchai', 'billing', 'botservice', 'cdn', 'cloud', 'cognitiveservices', 'configure', 'consumption', 'container', 'cosmosdb', 'dla', 'dls', 'dms', 'eventgrid', 'eventhubs', 'extension', 'feedback', 'find', 'hdinsight', 'interactive', 'iot', 'iotcentral', 'keyvault', 'kusto', 'lab', 'maps', 'monitor', 'network', 'policyinsights', 'profile', 'rdbms', 'redis', 'relay', 'reservations', 'resource', 'role', 'search', 'security', 'servicebus', 'servicefabric', 'signalr', 'sql', 'sqlvm', 'storage', 'vm']
Loaded module 'acr' in 0.005 seconds.
Loaded module 'acs' in 0.005 seconds.
Loaded module 'advisor' in 0.002 seconds.
Event: CommandLoader.OnLoadCommandTable []
Loaded module 'ams' in 0.005 seconds.
Loaded module 'appservice' in 0.021 seconds.
Loaded module 'backup' in 0.004 seconds.
Event: CommandLoader.OnLoadCommandTable []
Loaded module 'batch' in 0.009 seconds.
Loaded module 'batchai' in 0.004 seconds.
Loaded module 'billing' in 0.003 seconds.
Loaded module 'botservice' in 0.003 seconds.
Event: CommandLoader.OnLoadCommandTable []
Loaded module 'cdn' in 0.003 seconds.
Loaded module 'cloud' in 0.002 seconds.
Loaded module 'cognitiveservices' in 0.003 seconds.
Loaded module 'configure' in 0.002 seconds.
Loaded module 'consumption' in 0.003 seconds.
Loaded module 'container' in 0.003 seconds.
Loaded module 'cosmosdb' in 0.006 seconds.
Loaded module 'dla' in 0.006 seconds.
Loaded module 'dls' in 0.004 seconds.
Loaded module 'dms' in 0.003 seconds.
Loaded module 'eventgrid' in 0.004 seconds.
Loaded module 'eventhubs' in 0.004 seconds.
Loaded module 'extension' in 0.001 seconds.
Loaded module 'feedback' in 0.001 seconds.
Loaded module 'find' in 0.001 seconds.
Loaded module 'hdinsight' in 0.003 seconds.
Loaded module 'interactive' in 0.001 seconds.
Loaded module 'iot' in 0.005 seconds.
Loaded module 'iotcentral' in 0.002 seconds.
Loaded module 'keyvault' in 0.007 seconds.
Loaded module 'kusto' in 0.003 seconds.
Loaded module 'lab' in 0.004 seconds.
Loaded module 'maps' in 0.002 seconds.
Loaded module 'monitor' in 0.006 seconds.
Loaded module 'network' in 0.027 seconds.
Loaded module 'policyinsights' in 0.003 seconds.
Loaded module 'profile' in 0.002 seconds.
Loaded module 'rdbms' in 0.006 seconds.
Loaded module 'redis' in 0.003 seconds.
Loaded module 'relay' in 0.003 seconds.
Loaded module 'reservations' in 0.003 seconds.
Loaded module 'resource' in 0.007 seconds.
Loaded module 'role' in 0.005 seconds.
Loaded module 'search' in 0.003 seconds.
Loaded module 'security' in 0.003 seconds.
Loaded module 'servicebus' in 0.004 seconds.
Loaded module 'servicefabric' in 0.002 seconds.
Loaded module 'signalr' in 0.002 seconds.
Loaded module 'sql' in 0.007 seconds.
Loaded module 'sqlvm' in 0.003 seconds.
Event: CommandLoader.OnLoadCommandTable []
Loaded module 'storage' in 0.031 seconds.
Loaded module 'vm' in 0.013 seconds.
Loaded all modules in 0.267 seconds. (note: there's always an overhead with the first module loaded)
Extensions directory: '/home/fbte61/.azure/cliextensions'
Found 1 extensions: ['azure-devops']
Extensions directory: '/home/fbte61/.azure/cliextensions'
Loaded extension 'azure-devops' in 0.040 seconds.
Event: CommandInvoker.OnPreCommandTableTruncate []
Event: CommandInvoker.OnPostCommandTableCreate [
Event: CommandInvoker.OnCommandTableLoaded []
Event: CommandInvoker.OnPreParseArgs [
Event: CommandInvoker.OnPostParseArgs [
Extensions directory: '/home/fbte61/.azure/cliextensions'
Extensions directory: '/home/fbte61/.azure/cliextensions'
Remote url: https://#######[email protected]/#######cloudcoe/azure_demos/_git/module_demo_1
azext_devops.vstsCompressed._file_cache : Loading cache file: /home/fbte61/.azure/azuredevops/cache/remotes.json
azext_devops.vstsCompressed._file_cache : attempting to read file /home/fbte61/.azure/azuredevops/cache/remotes.json as utf-8-sig
Detect: Url discovery took 0:00:00.557366
Getting credential: azdevops-cli:https://dev.azure.com/#######cloudcoe
Getting credential: azdevops-cli: default
Current cloud config:
AzureCloud
trying to get token (temp) for tenant 04368cd7-79db-48c2-a243-1f6c2025dec8 and user bent.terp@#######.se
attempting to read file /home/fbte61/.azure/accessTokens.json as utf-8-sig
adal-python : e803a4b7-693b-441d-a22b-6829aa53c9b5 - Authority:Performing instance discovery: ...
adal-python : e803a4b7-693b-441d-a22b-6829aa53c9b5 - Authority:Performing static instance discovery
adal-python : e803a4b7-693b-441d-a22b-6829aa53c9b5 - Authority:Authority validated via static instance discovery
adal-python : e803a4b7-693b-441d-a22b-6829aa53c9b5 - TokenRequest:Getting token from cache with refresh if necessary.
adal-python : e803a4b7-693b-441d-a22b-6829aa53c9b5 - CacheDriver:finding with query keys: {'_clientId': '...', 'userId': '...'}
adal-python : e803a4b7-693b-441d-a22b-6829aa53c9b5 - CacheDriver:Looking for potential cache entries: {'_clientId': '...', 'userId': '...'}
adal-python : e803a4b7-693b-441d-a22b-6829aa53c9b5 - CacheDriver:Found 6 potential entries.
adal-python : e803a4b7-693b-441d-a22b-6829aa53c9b5 - CacheDriver:Resource specific token found.
adal-python : e803a4b7-693b-441d-a22b-6829aa53c9b5 - CacheDriver:Returning token from cache lookup, AccessTokenId: b'lZzQPLsuh/hlp+WmjCV2ZmLB30RMdRv7rrEOxqzC4Ho=', RefreshTokenId: b'fe6QmsCe2mPZThfl3pJx4AGOcHDZaRDtLXzNdH2vUh8='
msrest.universal_http.requests : Configuring retry: max_retries=3, backoff_factor=0.8, max_backoff=90
Current cloud config:
AzureCloud
Azure devops telemetry enabled.
Logging telemetry to azure devops server.
msrest.universal_http.requests : Configuring retry: max_retries=3, backoff_factor=0.8, max_backoff=90
msrest.universal_http.requests : Configuring retry: max_retries=3, backoff_factor=0.8, max_backoff=90
azext_devops.vstsCompressed._file_cache : Loading cache file: /home/fbte61/.vsts/python-sdk/cache/options.json
azext_devops.vstsCompressed._file_cache : Loading cache file: /home/fbte61/.vsts/python-sdk/cache/resources.json
azext_devops.vstsCompressed._file_cache : attempting to read file /home/fbte61/.vsts/python-sdk/cache/options.json as utf-8-sig
azext_devops.vstsCompressed._file_cache : attempting to read file /home/fbte61/.vsts/python-sdk/cache/resources.json as utf-8-sig
azext_devops.vstsCompressed.vss_connection : File cache hit for resources on: https://dev.azure.com/#######cloudcoe
msrest.universal_http.requests : Configuring retry: max_retries=3, backoff_factor=0.8, max_backoff=90
azext_devops.vstsCompressed.vss_client : File cache hit for options on: https://dev.azure.com/#######cloudcoe
azext_devops.vstsCompressed.vss_client : File cache hit for options on: https://dev.azure.com/#######cloudcoe
azext_devops.vstsCompressed.vss_client : Route template: _apis/{area}/{resource}
azext_devops.vstsCompressed.vss_client : Api version '4.0-preview.1'
azext_devops.vstsCompressed.vss_client : Route template: _apis/{resource}/{*projectId}
azext_devops.vstsCompressed.vss_client : POST https://dev.azure.com/#######cloudcoe/_apis/CustomerIntelligence/Events
azext_devops.vstsCompressed.vss_client : Api version '4.0'
azext_devops.vstsCompressed.vss_client : Request content: [{'area': 'AzureDevopsCli', 'feature': 'devops', 'properties': {'Command': 'project list', 'Args': [], 'ShellType': '/bin/bash'}}]
azext_devops.vstsCompressed.vss_client : GET https://dev.azure.com/#######cloudcoe/_apis/projects?stateFilter=all
msrest.universal_http : Configuring redirects: allow=True, max=30
azext_devops.vstsCompressed.vss_client : Request content: None
msrest.universal_http : Configuring request: timeout=100, verify=True, cert=None
msrest.universal_http : Configuring redirects: allow=True, max=30
msrest.universal_http : Configuring proxies: ''
msrest.universal_http : Configuring request: timeout=100, verify=True, cert=None
msrest.universal_http : Evaluate proxies against ENV settings: True
msrest.universal_http : Configuring proxies: ''
urllib3.connectionpool : Starting new HTTPS connection (1): dev.azure.com:443
msrest.universal_http : Evaluate proxies against ENV settings: True
urllib3.connectionpool : Starting new HTTPS connection (1): dev.azure.com:443
urllib3.connectionpool : https://dev.azure.com:443 "POST /#######cloudcoe/_apis/CustomerIntelligence/Events HTTP/1.1" 204 0
azext_devops.vstsCompressed.vss_client : Response content: b''
urllib3.connectionpool : https://dev.azure.com:443 "GET /#######cloudcoe/_apis/projects?stateFilter=all HTTP/1.1" 200 1154
azext_devops.vstsCompressed.vss_client : Response content: b'{"count":3,"value":[{"id":"ad5be174-e2ea-45e1-af79-c63ce98d3145","name":"azure_tf_mod","description":"Welcome to ####### Cloud CoE\'s library of Terraform modules to be used when deploying ####### solutions on Azure","url":"https://dev.azure.com/#######cloudcoe/_apis/projects/ad5be174-e2ea-45e1-af79-c63ce98d3145","state":"wellFormed","revision":28,"visibility":"private","lastUpdateTime":"2019-01-28T09:37:50.49Z"},{"id":"6ae8a6ea-3662-40cf-8b2e-10407e50cd96","name":"azure_demos","description":"Reference architectures aka \"demos\" for #######. Often depend on modules from azure_tf_mod","url":"https://dev.azure.com/#######cloudcoe/_apis/projects/6ae8a6ea-3662-40cf-8b2e-10407e50cd96","state":"wellFormed","revision":37,"visibility":"private","lastUpdateTime":"2019-01-29T12:00:47.18Z"},{"id":"be17e4b3-3e40-46c6-bf96-1c2b50049ffc","name":"azure_stack_test","description":"Evaluation of Azure Stack as Platform and PoC for IBM Change Data Capture","url":"https://dev.azure.com/#######cloudcoe/_apis/projects/be17e4b3-3e40-46c6-bf96-1c2b50049ffc","state":"wellFormed","revision":14,"visibility":"private","lastUpdateTime":"2019-01-28T07:58:39.647Z"}]}'
Event: CommandInvoker.OnTransformResult [
Event: CommandInvoker.OnFilterResult []
ID Name Visibility
6ae8a6ea-3662-40cf-8b2e-10407e50cd96 azure_demos Private
be17e4b3-3e40-46c6-bf96-1c2b50049ffc azure_stack_test Private
ad5be174-e2ea-45e1-af79-c63ce98d3145 azure_tf_mod Private
Event: Cli.PostExecute []
telemetry.save : Save telemetry record of length 2557 in cache
telemetry.check : Negative: The /home/fbte61/.azure/telemetry.txt was modified at 2019-03-06 10:50:52.333736, which in less than 600.000000 s```
Additional context
Add any other context about the problem here.
@bentterp : by any change are you running this cmd inside a git repository which points to the organization which is hosting the 3 projects you are getting in response?
@gauravsaralMs spot on! How did you guess :-) And yes when I move out of that dir, output is as expected.
Guess => because you got result from some random org :)
This is happening because of _detect_ option, it is ON by default and overrides config
Unfortunately we don't have a global thing to turn detect off right now.
so workaround is to use CLI from a different directory or pass off for --detect

Thank you. I saw that option but didn't understand what it meant....
Most helpful comment
@gauravsaralMs spot on! How did you guess :-) And yes when I move out of that dir, output is as expected.