Closed mathieugravil closed 5 years ago
Hi @mathieugravil ,
I suspect there is some mismatch in arguments you are passing. Your URL contains GUID, which shouldn't be the case.
Can you run the command in debug mode and share the logs ? [Add ' --debug' to your command]
Hello @ishitam8
Please find log:
mathieu@Azure:~$ az devops security group membership add --group-id "[monproj]\Project Administrators" --member-id "myuser.toto@mycomp.com" --organization "https://dev.azure.com/myorg" --debug
Command arguments: ['devops', 'security', 'group', 'membership', 'add', '--group-id', '[monproj]\Project Administrators', '--member-id', 'myuser.toto@mycomp.com', '--organization', 'https://dev.azure.com/myorg', '--debug']
Event: Cli.PreExecute []
Event: CommandParser.OnGlobalArgumentsCreate [<function CLILogging.on_global_arguments at 0x7fa86f59dd08>, <function OutputProducer.on_global_arguments at 0x7fa86f0d7b70>, <function CLIQuery.on_global_argumentsat 0x7fa86f101bf8>]
Event: CommandInvoker.OnPreCommandTableCreate []
Installed command modules ['acr', 'acs', 'advisor', 'ams', 'apim', 'appconfig', 'appservice', 'backup', 'batch', 'batchai', 'billing', 'botservice', 'cdn', 'cloud', 'cognitiveservices', 'configure', 'consumption', 'container', 'cosmosdb', 'deploymentmanager', 'dla', 'dls', 'dms', 'eventgrid', 'eventhubs', 'extension', 'feedback', 'find', 'hdinsight', 'interactive', 'iot', 'iotcentral', 'keyvault', 'kusto', 'lab', 'managedservices', 'maps', 'monitor', 'natgateway', 'netappfiles', 'network', 'policyinsights', 'privatedns', 'profile', 'rdbms', 'redis', 'relay', 'reservations', 'resource', 'role', 'search', 'security', 'servicebus', 'servicefabric', 'signalr', 'sql', 'sqlvm', 'storage', 'vm']
Loaded module 'acr' in 0.016 seconds.
Loaded module 'acs' in 0.006 seconds.
Loaded module 'advisor' in 0.001 seconds.
Event: CommandLoader.OnLoadCommandTable []
Loaded module 'ams' in 0.005 seconds.
Loaded module 'apim' in 0.002 seconds.
Loaded module 'appconfig' in 0.002 seconds.
Loaded module 'appservice' in 0.009 seconds.
Loaded module 'backup' in 0.003 seconds.
Event: CommandLoader.OnLoadCommandTable []
Loaded module 'batch' in 0.009 seconds.
Loaded module 'batchai' in 0.003 seconds.
Loaded module 'billing' in 0.001 seconds.
Loaded module 'botservice' in 0.003 seconds.
Event: CommandLoader.OnLoadCommandTable []
Loaded module 'cdn' in 0.002 seconds.
Loaded module 'cloud' in 0.001 seconds.
Loaded module 'cognitiveservices' in 0.002 seconds.
Loaded module 'configure' in 0.001 seconds.
Loaded module 'consumption' in 0.002 seconds.
Loaded module 'container' in 0.002 seconds.
Loaded module 'cosmosdb' in 0.007 seconds.
Loaded module 'deploymentmanager' in 0.003 seconds.
Loaded module 'dla' in 0.004 seconds.
Loaded module 'dls' in 0.003 seconds.
Loaded module 'dms' in 0.002 seconds.
Loaded module 'eventgrid' in 0.002 seconds.
Loaded module 'eventhubs' in 0.003 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.002 seconds.
Loaded module 'interactive' in 0.000 seconds.
Loaded module 'iot' in 0.005 seconds.
Loaded module 'iotcentral' in 0.001 seconds.
Loaded module 'keyvault' in 0.005 seconds.
Loaded module 'kusto' in 0.002 seconds.
Loaded module 'lab' in 0.003 seconds.
Loaded module 'managedservices' in 0.001 seconds.
Loaded module 'maps' in 0.002 seconds.
Loaded module 'monitor' in 0.005 seconds.
Loaded module 'natgateway' in 0.001 seconds.
Event: CommandLoader.OnLoadCommandTable []
Loaded module 'netappfiles' in 0.004 seconds.
Loaded module 'network' in 0.029 seconds.
Loaded module 'policyinsights' in 0.002 seconds.
Loaded module 'privatedns' in 0.005 seconds.
Loaded module 'profile' in 0.001 seconds.
Loaded module 'rdbms' in 0.007 seconds.
Loaded module 'redis' in 0.002 seconds.
Loaded module 'relay' in 0.003 seconds.
Loaded module 'reservations' in 0.002 seconds.
Loaded module 'resource' in 0.007 seconds.
Loaded module 'role' in 0.006 seconds.
Loaded module 'search' in 0.001 seconds.
Loaded module 'security' in 0.002 seconds.
Loaded module 'servicebus' in 0.005 seconds.
Loaded module 'servicefabric' in 0.002 seconds.
Loaded module 'signalr' in 0.002 seconds.
Loaded module 'sql' in 0.008 seconds.
Loaded module 'sqlvm' in 0.002 seconds.
Event: CommandLoader.OnLoadCommandTable []
Loaded module 'storage' in 0.032 seconds.
Loaded module 'vm' in 0.015 seconds.
Loaded all modules in 0.262 seconds. (note: there's always an overhead with the first module loaded)
Extensions directory: '/home/mathieu/.azure/cliextensions'
Found 2 extensions: ['azure-devops', 'aks-preview']
Extensions directory: '/home/mathieu/.azure/cliextensions'
Extension compatibility result: is_compatible=True cli_core_version=2.0.72 min_required=2.0.49 max_required=None
Extensions directory: '/home/mathieu/.azure/cliextensions'
Loaded extension 'azure-devops' in 0.022 seconds.
Extensions directory: '/home/mathieu/.azure/cliextensions'
Extension compatibility result: is_compatible=True cli_core_version=2.0.72 min_required=2.0.49 max_required=None
Event: CommandLoader.OnLoadCommandTable []
Extensions directory: '/home/mathieu/.azure/cliextensions'
Loaded extension 'aks-preview' in 0.003 seconds.
Event: CommandInvoker.OnPreCommandTableTruncate [<function AzCliLogging.init_command_file_logging at 0x7fa86ee7ff28>]
az_command_data_logger : command args: devops security group membership add --group-id {} --member-id {} --organization {} --debug
metadata file logging enabled - writing logs to '/home/mathieu/.azure/commands'.
Event: CommandInvoker.OnPreArgumentLoad [<function register_global_subscription_argument.
Hi @mathieugravil ,
To add a member to some group, you need to pass descriptor of that group and not group name . You can fetch the group descriptor by running group list command with query something similar to this
az devops security group list -p monproj -o json --query "graphGroups[?displayName == 'Project Administrators'].descriptor | [0]" -o tsv
You can use this descriptor to add members to the group.
az devops security group membership add --group-id <YOUR_GROUP_DESCRIPTOR> --member-id "myuser.toto@mycomp.com" --organization "https://dev.azure.com/myorg"
Let me know if this helps
ok it works. Thanks forr you help.
This is autogenerated. Please review and update as needed.
Describe the bug
urllib3.connectionpool : https://tgits-code.vssps.visualstudio.com:443 "PUT /_apis/Graph/Memberships/aad.MjhhYzI0NDktOGUxMC03NjJhLTg5MzgtOTNlZDEzYTU5OWM1/e1bd3e0f-d8e3-4859-a127-9f55cdc3f124 HTTP/1.1" 404 15 msrest.exceptions : Page not found. Operation returned an invalid status code of 404. handling generic error cli.azure.cli.core.util : request failed: Page not found. Operation returned an invalid status code of 404. request failed: Page not found. Operation returned an invalid status code of 404.
Command Name
az devops security group membership add Extension Name: azure-devops. Version: 0.12.0.
Errors:
To Reproduce:
Steps to reproduce the behavior. Note that argument values have been redacted, as they may contain sensitive information.
az devops security group membership add --member-id {} --group-id {} --organization {} --debug
Expected Behavior
add user on group
Environment Summary
Additional Context