Skip to content

'DefaultAzureCredential' object has no attribute 'signed_session' #466

@msl0

Description

@msl0

I'm trying to create a python script to interact with Azure DevOps and I have problem with authentication. I don't want to use PAT.
This works but I noticed it is recommended to use azure.identity instead of azure.common.credentials.get_azure_cli_credentials().

from azure.common.credentials import get_azure_cli_credentials
from azure.devops.connection import Connection

credential = get_azure_cli_credentials()[0]
connection = Connection(base_url="https://dev.azure.com/org_name", creds=credential)
core_client = connection.clients.get_core_client()
projects = core_client.get_projects()

When I try to use DefaultAzureCredential from azure.identity, I get following error:

'DefaultAzureCredential' object has no attribute 'signed_session'

from azure.identity import DefaultAzureCredential
from azure.devops.connection import Connection

credential = DefaultAzureCredential()
connection = Connection(base_url="https://dev.azure.com/org_name", creds=credential)
core_client = connection.clients.get_core_client()
projects = core_client.get_projects()

azure.identity = 1.12.0
azure.devops = 7.1.0b3
azure.common = 1.1.11

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions