-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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: AttributeError: 'DefaultAzureCredential' object has no attribute 'signed_session' #15330
Comments
credential = DefaultAzureCredential()
subscription_client = SubscriptionClient(credential)
wrapped_credential = AzureIdentityCredentialAdapter(credential)
policy_client = PolicyInsightsClient(credentials=wrapped_credential) A future version of azure-mgmt-policyinsights may not require the adapter, but I don't know the roadmap for that library. @changlong-liu is a track 2 version planned? (Related: #14499) |
Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @kenieva. Issue Details
|
add @msyyc for comments on azure-mgmt-policyinsights track2 plan :) |
azure-mgmt-policyinsights for python track2 will be published next month(2020/12/30) |
@murarisumit can you confirm if the above solution solved the issue? |
I have a try and the above solution works well. |
I have faced the similar (Signed_Session) kind of issue while working with Azure nsgs and have fixed it. There might be 2 causes.
To import/work with "azure.mgmt.network import NetworkManagementClient", we need to install "azure-mgmt-network==19.0.0" library but not "azure-mgmt. Just think on above 2 ways..it may helps you. |
hey @changlong-liu `# ------------------------------------ Copyright (c) Microsoft Corporation.Licensed under the MIT License.------------------------------------Adapt credentials from azure-identity to be compatible with SDK that needs msrestazure or azure.common.credentialsNeed msrest >= 0.6.0See also https://pypi.org/project/azure-identity/import logging from azure.core.pipeline import PipelineContext, PipelineRequest log = logging.getLogger(name) def _make_request(url: str) -> PipelineRequest[Any]: class AzureIdentityCredentialAdapter(BasicTokenAuthentication):
` I am getting below error:
Please help me in resolving above issue. Thanks |
Package Name:
azure.mgmt.policyinsights
Package Version:
azure-mgmt-policyinsights==0.6.0
Azure Packages Version:
azure-common==1.1.25
azure-core==1.9.0
azure-identity==1.5.0
azure-mgmt-core==1.2.2
azure-mgmt-policyinsights==0.6.0
azure-mgmt-resource==15.0.0
azure-mgmt-storage==16.0.0
msrestazure==0.6.4
Operating System:
MacOS
Python Version:
Python 3.8.5
Describe the bug
Getting this error while performing operation in this library: AttributeError: 'DefaultAzureCredential' object has no attribute 'signed_session'
To Reproduce
Try calling this method: https://docs.microsoft.com/en-us/python/api/azure-mgmt-policyinsights/azure.mgmt.policyinsights.operations.operations?view=azure-python
Expected behavior
List method mentioned above should've listed operation.
Additional context
Found this error at: https://docs.microsoft.com/en-us/azure/developer/python/azure-sdk-authenticate?view=azure-python&tabs=cmd#defaultazurecredential-object-has-no-attribute-signed-session
Currently using DefaultAzureCredential with version 15.0.0 or higher of azure-mgmt-resource :
azure-mgmt-resource==15.0.0
.Still facing this issue
The text was updated successfully, but these errors were encountered: