Skip to content

cannot import name 'Identity' from partially initialized module 'azure.cli.core.auth.identity' (most likely due to a circular import) #28808

Description

@Poil

Describe the bug

Circular import randomly

"cannot import name 'Identity' from partially initialized module 'azure.cli.core.auth.identity' 
"cannot import name 'BinaryCache' from partially initialized module 'azure.cli.core.auth.binary_cache'
"cannot import name 'RequestsTransport' from partially initialized module 'azure.core.pipeline.transport._requests_basic'

Related command

az vm start --ids /subscriptions/xxxxxxxxxxxxxxx/resourceGroups/xxxxxxxxxxx/providers/Microsoft.Compute/virtualMachines/xxxxxxxxxx /subscriptions/xxxxxxxxxxxxxxx/resourceGroups/xxxxxxxxxxx/providers/Microsoft.Compute/virtualMachines/xxxxxxxxxx --no-wait

Errors

"cannot import name 'Identity' from partially initialized module 'azure.cli.core.auth.identity' 
"cannot import name 'BinaryCache' from partially initialized module 'azure.cli.core.auth.binary_cache'
"cannot import name 'RequestsTransport' from partially initialized module 'azure.core.pipeline.transport._requests_basic'

Issue script & Debug output

n/a

Expected behavior

no error

Environment Summary

(azure-cli-venv) root@2ea9794aadff:/# az --version
azure-cli 2.59.0

core 2.59.0
telemetry 1.1.0

Dependencies:
msal 1.27.0
azure-mgmt-resource 23.1.0b2

Python location '/root/azure-cli-venv/bin/python3'
Extensions directory '/root/.azure/cliextensions'

Python (Linux) 3.9.2 (default, Feb 28 2021, 17:03:44)
[GCC 10.2.1 20210110]

Additional context

Installed in a virtualenv via pip install azure-cli
Note that there is no error if only one ID is given to the command

Metadata

Metadata

Labels

Auto-AssignAuto assign by botAzure CLI TeamThe command of the issue is owned by Azure CLI teamComputeaz vm/vmss/image/disk/snapshotact-observability-squadcustomer-reportedIssues that are reported by GitHub users external to the Azure organization.potential-pruningquestionThe issue doesn't require a change to the product in order to be resolved. Most issues start as that

Type

No type
No fields configured for issues without a type.

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions