microsoft / microsoft/azure-devops-python-api

'DefaultAzureCredential' object has no attribute 'signed_session'

未關閉
#466 6 則留言 5 個 reaction 已指派 0 人 在 GitHub 檢視

還沒有人認領這個 Issue。

主要語言
Python
星號
684
分支
218
平均合併
8 天 10 小時
30 天內合併 PR
1

描述

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

貢獻指南

這個儲存庫沒有索引到貢獻指南

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

研究方向

先使用所示的 DefaultAzureCredential 和 azure.devops Connection 範例重現問題,然後比較 Connection 和 azure.identity 使用的認證介面。檢查回報的版本是否支援此驗證路徑;當一個有文件說明的非 PAT 連線能夠在沒有 signed_session 錯誤的情況下取得專案時,即表示完成。

由索引模型根據 Issue 內容生成。

評估

技術堆疊
azure, python
領域
api, authentication
Issue 類型
缺陷
難度
4/5
預估耗時
3-5 天
活躍度
停滯
描述清晰度
需要釐清
新手友好度
42/100

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。