Skip to content

Command works on bash cloud shell but not locally: az servicebus namespace authorization-rule keys list #26345

@OTheDev

Description

@OTheDev

Describe the bug

Command Name
az servicebus namespace authorization-rule keys list

Commands prefixed with az servicebus throw an error when run locally on Rosetta terminal on my M1 MacBook pro. I use the Azure CLI quite a lot and don't have recurrent issues with other commands.

As a workaround, I run az servicebus commands on the Azure Portal Cloud Shell (bash). The same commands that fail locally work on the cloud shell. This is not ideal, particularly when we need to retrieve the connection string for the namespace in a build process.

Errors:

The command failed with an unexpected error. Here is the traceback:
option values must be strings
Traceback (most recent call last):
  File "/usr/local/Cellar/azure-cli/2.48.1/libexec/lib/python3.10/site-packages/knack/cli.py", line 233, in invoke
    cmd_result = self.invocation.execute(args)
  File "/usr/local/Cellar/azure-cli/2.48.1/libexec/lib/python3.10/site-packages/azure/cli/core/commands/__init__.py", line 680, in execute
    self.cli_ctx.save_local_context(parsed_args, self.commands_loader.command_table[command].arguments,
  File "/usr/local/Cellar/azure-cli/2.48.1/libexec/lib/python3.10/site-packages/azure/cli/core/__init__.py", line 154, in save_local_context
    self.local_context.set(lca.scopes, lca.name, value)
  File "/usr/local/Cellar/azure-cli/2.48.1/libexec/lib/python3.10/site-packages/azure/cli/core/local_context.py", line 116, in set
    self._local_context_file.set_value(scope.lower(), argument, value)
  File "/usr/local/Cellar/azure-cli/2.48.1/libexec/lib/python3.10/site-packages/knack/config.py", line 239, in set_value
    config.set(section, option, value)
  File "/usr/local/Cellar/python@3.10/3.10.11/Frameworks/Python.framework/Versions/3.10/lib/python3.10/configparser.py", line 1205, in set
    self._validate_value_types(option=option, value=value)
  File "/usr/local/Cellar/python@3.10/3.10.11/Frameworks/Python.framework/Versions/3.10/lib/python3.10/configparser.py", line 1190, in _validate_value_types
    raise TypeError("option values must be strings")
TypeError: option values must be strings

To Reproduce:

az servicebus namespace authorization-rule keys list                          \
    --resource-group $RESOURCE_GROUP                                          \
    --namespace-name $SBUS_NAMESPACE                                          \
    --name RootManageSharedAccessKey                                          \
    --query primaryConnectionString --output tsv

Expected Behavior

It should output something like

Endpoint=sb://<sbus_namespace>.servicebus.windows.net/;SharedAccessKeyName=RootManageSharedAccessKey;SharedAccessKey=<shared_access_key>=

Environment Summary

macOS-12.5-x86_64-i386-64bit, Darwin 21.6.0
Python 3.10.11
Installer: HOMEBREW

azure-cli 2.48.1

Extensions:
ai-examples 0.2.5
ml 2.16.0
ssh 1.1.6

Dependencies:
msal 1.20.0
azure-mgmt-resource 22.0.0

Metadata

Metadata

Assignees

Labels

Auto-AssignAuto assign by botCXP AttentionThis issue is handled by CXP team.Service Busaz servicebuscustomer-reportedIssues that are reported by GitHub users external to the Azure organization.needs-author-feedbackMore information is needed from author to address the issue.questionThe issue doesn't require a change to the product in order to be resolved. Most issues start as that

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions