Azure / Azure/azure-cli-extensions
No module named 'azure.communication' error when trying to get acs token from macbook
- Dominant language
- Python
- Stars
- 454
- Forks
- 1.7k
- Avg merge
- 2d 19h
- Merged PRs (30d)
- 64
Description
### Describe the bug
This bug report is being moved from MicrosoftDocs/azure-docs issue #[119472](https://github.com/MicrosoftDocs/azure-docs/issues/119472). This issue seems to be related to unresolved issue [#24453](https://github.com/Azure/azure-cli/issues/24453).
REQUEST: Please route this issue to the Azure service team and have them respond to @juliays in this new GitHub issue. The customer reports as follows:
**From @juliays on Feb 2, 2024:**
"
trying this command to get acs communication token.
**az communication identity token issue --scope voip --connection-string ""**
az version 2.56.0 and up to date.
Got this error below -
Command group 'az communication identity' is in preview and under development. Reference and support levels: https://aka.ms/CLI_refstatus
**The command failed with an unexpected error. Here is the traceback:
No module named 'azure.communication'**
Traceback (most recent call last):
File "/opt/homebrew/Cellar/azure-cli/2.56.0/libexec/lib/python3.11/site-packages/knack/cli.py", line 233, in invoke
cmd_result = self.invocation.execute(args)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/homebrew/Cellar/azure-cli/2.56.0/libexec/lib/python3.11/site-packages/azure/cli/core/commands/init.py", line 663, in execute
raise ex
File "/opt/homebrew/Cellar/azure-cli/2.56.0/libexec/lib/python3.11/site-packages/azure/cli/core/commands/init.py", line 726, in _run_jobs_serially
results.append(self._run_job(expanded_arg, cmd_copy))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/homebrew/Cellar/azure-cli/2.56.0/libexec/lib/python3.11/site-packages/azure/cli/core/commands/init.py", line 697, in _run_job
result = cmd_copy(params)
^^^^^^^^^^^^^^^^
File "/opt/homebrew/Cellar/azure-cli/2.56.0/libexec/lib/python3.11/site-packages/azure/cli/core/commands/init.py", line 333, in call
return self.handler(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/homebrew/Cellar/azure-cli/2.56.0/libexec/lib/python3.11/site-packages/azure/cli/core/commands/command_operation.py", line 112, in handler
client = self.client_factory(self.cli_ctx, command_args) if self.client_factory else None
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/yangsong/.azure/cliextensions/communication/azext_communication/manual/_client_factory.py", line 13, in cf_communication_identity
from azure.communication.identity import CommunicationIdentityClient
ModuleNotFoundError: No module named 'azure.communication'
"
**From @dbradish-microsoft on Feb 7, 2024:**
"
@juliays, How did you install the extension? Try using az extension add --name communication. Your error "No module named 'azure.communication'" makes me wonder if the extension is installed.
"
**From @juliays on Feb 7, 2024**
"
I ran the command below and here are the output. I have a macbook. One suggestion is that you also list the option to generate token via portal and cloudshell so ppl have a workaround when it doesn't work. Thanks!
az extension add --name communication --allow-preview true
Extension 'communication' 1.8.0b1 is already installed.
➜ main git:(main) az communication identity token issue --scope voip --connection-string "connectionString"
This command is implicitly deprecated because command group 'communication identity token' is deprecated and will be removed in a future release. Use 'communication user-identity token' instead.
Command group 'az communication identity' is in preview and under development. Reference and support levels: https://aka.ms/CLI_refstatus
The command failed with an unexpected error. Here is the traceback:
No module named 'azure.communication'
Traceback (most recent call last):
File "/opt/homebrew/Cellar/azure-cli/2.56.0/libexec/lib/python3.11/site-packages/knack/cli.py", line 233, in invoke
cmd_result = self.invocation.execute(args)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/homebrew/Cellar/azure-cli/2.56.0/libexec/lib/python3.11/site-packages/azure/cli/core/commands/init.py", line 663, in execute
raise ex
File "/opt/homebrew/Cellar/azure-cli/2.56.0/libexec/lib/python3.11/site-packages/azure/cli/core/commands/init.py", line 726, in _run_jobs_serially
results.append(self._run_job(expanded_arg, cmd_copy))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/homebrew/Cellar/azure-cli/2.56.0/libexec/lib/python3.11/site-packages/azure/cli/core/commands/init.py", line 697, in _run_job
result = cmd_copy(params)
^^^^^^^^^^^^^^^^
File "/opt/homebrew/Cellar/azure-cli/2.56.0/libexec/lib/python3.11/site-packages/azure/cli/core/commands/init.py", line 333, in call
return self.handler(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/homebrew/Cellar/azure-cli/2.56.0/libexec/lib/python3.11/site-packages/azure/cli/core/commands/command_operation.py", line 112, in handler
client = self.client_factory(self.cli_ctx, command_args) if self.client_factory else None
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/yangsong/.azure/cliextensions/communication/azext_communication/manual/_client_factory.py", line 13, in cf_communication_identity
from azure.communication.identity import CommunicationIdentityClient
ModuleNotFoundError: No module named 'azure.communication'
"
### Related command
az communication
### Errors
The command failed with an unexpected error. Here is the traceback:
No module named 'azure.communication'
### Issue script & Debug output
Please see above
### Expected behavior
The `az communication` module installs without error
### Environment Summary
azure-cli/2.56.0/libexec/lib/python3.11
### Additional context
_No response_
Contributor guide
Assessment
This issue has not been assessed yet.