Git - Get My Git Credentials
傳回使用者的 Git 認證組態詳細數據。
指出如何取得使用者的認證,以自動或透過設定的連線來存取相關的 Git 提供者。 如果未設定使用者的認證,請移至 更新我的 Git 認證 API。
權限
呼叫者必須具有 參與者 或更高的工作區角色。
必要的委派範圍
Workspace.Read.All 或 Workspace.ReadWrite.All
Microsoft Entra 支援的身分識別
此 API 支援本節中列出的Microsoft 身分識別。
| 身份 | 支援 |
|---|---|
| 使用者 | 是的 |
| 服務主體 和 受控識別 | 是的 |
介面
GET https://api.fabric.microsoft.com/v1/workspaces/{workspaceId}/git/myGitCredentials
URI 參數
| 名稱 | 位於 | 必要 | 類型 | Description |
|---|---|---|---|---|
|
workspace
|
path | True |
string (uuid) |
工作區標識碼。 |
回應
| 名稱 | 類型 | Description |
|---|---|---|
| 200 OK | GitCredentialsConfigurationResponse: |
要求成功完成。 |
| Other Status Codes |
常見的錯誤碼:
|
範例
Get the user's Git credentials configuration for Azure DevOps when it is automatic example
範例要求
GET https://api.fabric.microsoft.com/v1/workspaces/1565e6a3-c020-4c0c-dda7-92bafe99eec5/git/myGitCredentials
範例回覆
{
"source": "Automatic"
}
Get the user's Git credentials configuration when it is configured by connection example
範例要求
GET https://api.fabric.microsoft.com/v1/workspaces/1565e6a3-c020-4c0c-dda7-92bafe99eec5/git/myGitCredentials
範例回覆
{
"source": "ConfiguredConnection",
"connectionId": "3f2504e0-4f89-11d3-9a0c-0305e82c3301"
}
Get the user's Git credentials configuration when it is not configured example
範例要求
GET https://api.fabric.microsoft.com/v1/workspaces/1565e6a3-c020-4c0c-dda7-92bafe99eec5/git/myGitCredentials
範例回覆
{
"source": "None"
}
定義
| 名稱 | Description |
|---|---|
|
Automatic |
自動 Git 認證。 |
|
Configured |
已設定連線 Git 認證。 |
|
Error |
錯誤相關的資源詳細資料物件。 |
|
Error |
錯誤回應。 |
|
Error |
錯誤回應詳細數據。 |
|
Git |
Git 認證來源。 可能會隨著時間新增其他 Git 認證來源。 |
|
None |
未設定 Git 認證。 |
AutomaticGitCredentialsResponse
自動 Git 認證。
| 名稱 | 類型 | Description |
|---|---|---|
| source |
string:
Automatic |
Git 認證來源。 |
ConfiguredConnectionGitCredentialsResponse
已設定連線 Git 認證。
| 名稱 | 類型 | Description |
|---|---|---|
| connectionId |
string (uuid) |
連接的物件識別碼。 |
| source |
string:
Configured |
Git 認證來源。 |
ErrorRelatedResource
錯誤相關的資源詳細資料物件。
| 名稱 | 類型 | Description |
|---|---|---|
| resourceId |
string |
發生錯誤的資源識別碼。 |
| resourceType |
string |
發生錯誤的資源類型。 |
ErrorResponse
錯誤回應。
| 名稱 | 類型 | Description |
|---|---|---|
| errorCode |
string |
提供錯誤狀況相關信息的特定標識碼,允許服務與其使用者之間的標準化通訊。 |
| message |
string |
錯誤的人類可讀取表示法。 |
| moreDetails |
其他錯誤詳細數據的清單。 |
|
| relatedResource |
錯誤相關的資源詳細數據。 |
|
| requestId |
string |
與錯誤相關聯的要求標識碼。 |
ErrorResponseDetails
錯誤回應詳細數據。
| 名稱 | 類型 | Description |
|---|---|---|
| errorCode |
string |
提供錯誤狀況相關信息的特定標識碼,允許服務與其使用者之間的標準化通訊。 |
| message |
string |
錯誤的人類可讀取表示法。 |
| relatedResource |
錯誤相關的資源詳細數據。 |
GitCredentialsSource
Git 認證來源。 可能會隨著時間新增其他 Git 認證來源。
| 值 | Description |
|---|---|
| ConfiguredConnection |
Git 認證是透過設定的連線取得。 |
| Automatic |
系統會自動取得 Git 認證,如果有的話,請使用預設認證。 |
| None |
未設定 Git 認證。 |
NoneGitCredentialsResponse
未設定 Git 認證。
| 名稱 | 類型 | Description |
|---|---|---|
| source |
string:
None |
Git 認證來源。 |