Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error while setting up Azure IoT Operations (az iot ops init) #28133

Closed
iitsDelbruegger opened this issue Jan 4, 2024 · 7 comments
Closed

Error while setting up Azure IoT Operations (az iot ops init) #28133

iitsDelbruegger opened this issue Jan 4, 2024 · 7 comments
Labels
Auto-Assign Auto assign by bot Auto-Resolve Auto resolve by bot bug This issue requires a change to an existing behavior in the product in order to be resolved. customer-reported Issues that are reported by GitHub users external to the Azure organization. IoT/CLI IoT Service Attention This issue is responsible by Azure service team. Similar-Issue

Comments

@iitsDelbruegger
Copy link

Describe the bug

When following the quickstart instructions here: https://learn.microsoft.com/en-us/azure/iot-operations/get-started/quickstart-deploy?tabs=linux

on a MicroK8s running on a MacBook Pro with M2 processor, we successfully connected the Kubernetes cluster with Azure Arc. However, we cannot initialize IoT Operations because we get an error message that the azure.identity python module is missing.

Related command

az iot ops init --cluster tim-cluster-test -g tim-rg-test --kv-id /subscriptions/*****/resourcegroups/tim-rg-test/providers/Microsoft.KeyVault/vaults/tim-kv-test

Errors

The error I am getting:
ModuleNotFoundError: No module named 'azure.identity'

Command group 'iot ops' 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.identity'
Traceback (most recent call last):
  File "/opt/homebrew/Cellar/azure-cli/2.55.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.55.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.55.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.55.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.55.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.55.0/libexec/lib/python3.11/site-packages/azure/cli/core/commands/command_operation.py", line 121, in handler
    return op(**command_args)
           ^^^^^^^^^^^^^^^^^^
  File "/Users/tim/.azure/cliextensions/azure-iot-ops/azext_edge/edge/commands_edge.py", line 185, in init
    return deploy(
           ^^^^^^^
  File "/Users/tim/.azure/cliextensions/azure-iot-ops/azext_edge/edge/providers/orchestration/work.py", line 481, in deploy
    return manager.do_work()
           ^^^^^^^^^^^^^^^^^
  File "/Users/tim/.azure/cliextensions/azure-iot-ops/azext_edge/edge/providers/orchestration/work.py", line 156, in do_work
    from .base import (
  File "/Users/tim/.azure/cliextensions/azure-iot-ops/azext_edge/edge/providers/orchestration/base.py", line 20, in <module>
    from ...util.az_client import get_resource_client
  File "/Users/tim/.azure/cliextensions/azure-iot-ops/azext_edge/edge/util/az_client.py", line 7, in <module>
    from azure.identity import AzureCliCredential
ModuleNotFoundError: No module named 'azure.identity'
To check existing issues, please visit: https://github.com/Azure/azure-cli/issues

Issue script & Debug output

Expected behavior

The command should configure my cluster to work with Azure IoT Operations.

Environment Summary

az --version
azure-cli                         2.55.0

core                              2.55.0
telemetry                          1.1.0

Extensions:
azure-iot                         0.23.1
azure-iot-ops                    0.2.0b1
connectedk8s                       1.6.2

Dependencies:
msal                            1.24.0b2
azure-mgmt-resource             23.1.0b2

Python location '/opt/homebrew/Cellar/azure-cli/2.55.0/libexec/bin/python'
Extensions directory '/Users/tim/.azure/cliextensions'

Python (Darwin) 3.11.7 (main, Dec  4 2023, 18:10:11) [Clang 15.0.0 (clang-1500.1.0.2.5)]

Legal docs and information: aka.ms/AzureCliLegal


Your CLI is up-to-date.

Additional context

No response

@iitsDelbruegger iitsDelbruegger added the bug This issue requires a change to an existing behavior in the product in order to be resolved. label Jan 4, 2024
Copy link

Hi @iitsDelbruegger
Find similar issue #22192.

Issue title ModuleNotFoundError: No module named 'azure.identity' in latest CLI (v2.36.0)
Create time 2022-04-26
Comment number 6

Please confirm if this resolves your issue.

@microsoft-github-policy-service microsoft-github-policy-service bot added customer-reported Issues that are reported by GitHub users external to the Azure organization. IoT Service Attention This issue is responsible by Azure service team. Auto-Assign Auto assign by bot labels Jan 4, 2024
@yonzhan
Copy link
Collaborator

yonzhan commented Jan 4, 2024

Thank you for opening this issue, we will look into it.

Copy link
Contributor

Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @Azure/azure-iot-cli-triage.

@iitsDelbruegger
Copy link
Author

Hi @iitsDelbruegger Find similar issue #22192.

Issue title ModuleNotFoundError: No module named 'azure.identity' in latest CLI (v2.36.0)
Create time 2022-04-26
Comment number 6
Please confirm if this resolves your issue.

Well that issue might be related, if the current azure iot operations still assumes that the azure-identity module is provided by the azure cli. However, that issue was closed more than one year ago, so I would think that the problem should be fixed by now.

@c-ryan-k
Copy link
Member

c-ryan-k commented Jan 8, 2024

Hey @iitsDelbruegger - thanks for bringing this to our attention.

Our extension does include azure-identity as a requirement, but it seems there's an issue that's surfacing through homebrew CLI installs causing the CLI's module directory (which includes other azure.* namespaced packages) to be checked first.

The command then fails to find our included azure-identity package that resides in the extension's modules directory ~/.azure/cliextension/azure-iot-ops which is causing the failure here.

We're working on our fix now and should have an updated release this week.

In the meantime, if you just need to continue testing without a production fix in place, you could install azure-identity into the CLI's modules directory by using:
/opt/homebrew/Cellar/azure-cli/2.55.0/libexec/bin/python -m pip install azure-identity

@c-ryan-k
Copy link
Member

@iitsDelbruegger - we've released an updated extension v0.2.0b2 that should address this issue.

Could you please update your extension version with az extension update --name azure-iot-ops and see if this fixes your issue?

@vilit1
Copy link
Contributor

vilit1 commented May 13, 2024

Closing since there has been no response. If you still have issues, feel free to reopen!

@vilit1 vilit1 closed this as completed May 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Auto-Assign Auto assign by bot Auto-Resolve Auto resolve by bot bug This issue requires a change to an existing behavior in the product in order to be resolved. customer-reported Issues that are reported by GitHub users external to the Azure organization. IoT/CLI IoT Service Attention This issue is responsible by Azure service team. Similar-Issue
Projects
None yet
Development

No branches or pull requests

4 participants