- Package Name: azure.identity
- Package Version: 1.5.0
- Operating System: Windows
- Python Version: 3.6.13
Describe the bug
This page: https://docs.microsoft.com/en-us/azure/developer/python/azure-sdk-authenticate
contains this snippet:
from azure.identity import AzureCliCredential
from azure.mgmt.resource import SubscriptionClient
credential = AzureCliCredential()
subscription_client = SubscriptionClient(credential)
subscription = next(subscription_client.subscriptions.list())
print(subscription.subscription_id)
but it doesn't work, I get this error:
Exception has occurred: AttributeError
'AzureCliCredential' object has no attribute 'signed_session'
File "D:\Temp\copilot\test.py", line 27, in get_cli_credential
subscription = next(subscription_client.subscriptions.list())
File "D:\Temp\copilot\test.py", line 31, in
get_cli_credential()
To Reproduce
Steps to reproduce the behavior:
- Run the above snippet from VS code launched from CLI that you did "az login" already.
Expected behavior
Published code snippets should be tested on an ongoing basis.
Screenshots
If applicable, add screenshots to help explain your problem.
Additional context
Add any other context about the problem here.
Describe the bug
This page: https://docs.microsoft.com/en-us/azure/developer/python/azure-sdk-authenticate
contains this snippet:
but it doesn't work, I get this error:
Exception has occurred: AttributeError
'AzureCliCredential' object has no attribute 'signed_session'
File "D:\Temp\copilot\test.py", line 27, in get_cli_credential
subscription = next(subscription_client.subscriptions.list())
File "D:\Temp\copilot\test.py", line 31, in
get_cli_credential()
To Reproduce
Steps to reproduce the behavior:
Expected behavior
Published code snippets should be tested on an ongoing basis.
Screenshots
If applicable, add screenshots to help explain your problem.
Additional context
Add any other context about the problem here.