When running az keyvault set-policy --name $kv_name --resource-group $rg_name --secret-permissions set get list delete I receive the following error. The word "subscriptable" is not in the Merriam Webster dictionary. What does this error code refer to?
The command failed with an unexpected error. Here is the traceback:
'NoneType' object is not subscriptable
Traceback (most recent call last):
File "/opt/az/lib/python3.6/site-packages/knack/cli.py", line 206, in invoke
cmd_result = self.invocation.execute(args)
File "/opt/az/lib/python3.6/site-packages/azure/cli/core/commands/__init__.py", line 603, in execute
raise ex
File "/opt/az/lib/python3.6/site-packages/azure/cli/core/commands/__init__.py", line 661, in _run_jobs_serially
results.append(self._run_job(expanded_arg, cmd_copy))
File "/opt/az/lib/python3.6/site-packages/azure/cli/core/commands/__init__.py", line 654, in _run_job
six.reraise(*sys.exc_info())
File "/opt/az/lib/python3.6/site-packages/six.py", line 693, in reraise
raise value
File "/opt/az/lib/python3.6/site-packages/azure/cli/core/commands/__init__.py", line 631, in _run_job
result = cmd_copy(params)
File "/opt/az/lib/python3.6/site-packages/azure/cli/core/commands/__init__.py", line 306, in __call__
return self.handler(*args, **kwargs)
File "/opt/az/lib/python3.6/site-packages/azure/cli/core/__init__.py", line 485, in default_command_handler
return op(**command_args)
File "/opt/az/lib/python3.6/site-packages/azure/cli/command_modules/keyvault/custom.py", line 448, in set_policy
object_id = _object_id_args_helper(cmd.cli_ctx, object_id, spn, upn)
File "/opt/az/lib/python3.6/site-packages/azure/cli/command_modules/keyvault/custom.py", line 433, in _object_id_args_helper
object_id = _get_object_id(graph_client, spn=spn, upn=upn)
File "/opt/az/lib/python3.6/site-packages/azure/cli/command_modules/keyvault/custom.py", line 214, in _get_object_id
return _get_object_id_from_subscription(graph_client, subscription)
File "/opt/az/lib/python3.6/site-packages/azure/cli/command_modules/keyvault/custom.py", line 197, in _get_object_id_from_subscription
if subscription['user']:
TypeError: 'NoneType' object is not subscriptable
To open an issue, please run: 'az feedback'
⚠Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.
@bim-msft please take a look
@SeaDude Hi, which version are you using? (you can use az --version to see the version)
@bim-msft, I'm using Azure Notebooks. Here are the results:
!az --version
azure-cli 2.0.76 *
command-modules-nspkg 2.0.3
core 2.0.76 *
nspkg 3.0.4
telemetry 1.0.4
Python location '/opt/az/bin/python3'
Extensions directory '/home/nbuser/.azure/cliextensions'
Python (Linux) 3.6.5 (default, Oct 30 2019, 06:32:16)
[GCC 5.4.0 20160609]
Legal docs and information: aka.ms/AzureCliLegal
Hi @SeaDude , this version is an extremely old one, this bug was fixed nearly a half years ago... The latest is 2.6.0, would you have the chance to upgrade it in your environment? I am not familiar with Azure Notebooks but I think there should be a way to upgrade it.
FYI: subscriptable is a Python term: https://stackoverflow.com/questions/216972/what-does-it-mean-if-a-python-object-is-subscriptable-or-not . It's not in the Merriam Webster dictionary. 😄
@bim-msft , Azure Notebooks is a Microsoft product (hosted Jupyter notebooks). The underlying packages such as az cli are not accessible. I wish Microsoft would update Azure Notebooks Anaconda instance (and things like az cli)! The Python kernel is over 1.5 years old!
@SeaDude I believe this product is nearly abadoned... because the last commit was Apr 2019, and tons of issues do not have been assigned and resolved. Anyway, I will create a new issue to let them know the outdated cli things. Thanks!
Most helpful comment
FYI:
subscriptableis a Python term: https://stackoverflow.com/questions/216972/what-does-it-mean-if-a-python-object-is-subscriptable-or-not . It's not in the Merriam Webster dictionary. 😄