Git - Update My Git Credentials
更新使用者的 Git 認證組態詳細數據。
工作區中的每個使用者都有自己的設定 Git 認證。 您可以使用 取得我的 Git 認證 API 來取得 Git 認證組態。
若要取得連線標識碼,請參閱 自動化 Git 整合。
權限
呼叫者必須具有 參與者 或更高的工作區角色。
針對已設定的連接 Git 認證,呼叫端必須具有連線的許可權。
必要的委派範圍
Workspace.ReadWrite.All
局限性
使用自動認證來源時,會針對 GitHub 提供者和服務主體封鎖此 API。
Microsoft Entra 支援的身分識別
此 API 支援本節中列出的Microsoft 身分識別。
| 身份 | 支援 |
|---|---|
| 使用者 | 是的 |
| 服務主體 和 受控識別 | 只有在來源為 ConfiguredConnection 或 None 時才支援 |
介面
PATCH https://api.fabric.microsoft.com/v1/workspaces/{workspaceId}/git/myGitCredentials
URI 參數
| 名稱 | 位於 | 必要 | 類型 | Description |
|---|---|---|---|---|
|
workspace
|
path | True |
string (uuid) |
工作區標識碼。 |
要求本文
要求主體可以是下列其中一項:
| 名稱 | Description |
|---|---|
|
Update |
包含將 Git 認證更新為自動的要求數據。 |
|
Update |
包含將 Git 認證更新為已設定連線的要求數據。 |
|
Update |
包含將 Git 認證更新為 none 的要求數據。 |
UpdateGitCredentialsToAutomaticRequest
包含將 Git 認證更新為自動的要求數據。
| 名稱 | 必要 | 類型 | Description |
|---|---|---|---|
| source | True |
string:
Automatic |
Git 認證來源。 |
UpdateGitCredentialsToConfiguredConnectionRequest
包含將 Git 認證更新為已設定連線的要求數據。
| 名稱 | 必要 | 類型 | Description |
|---|---|---|---|
| connectionId | True |
string (uuid) |
連接的物件識別碼。 |
| source | True |
string:
Configured |
Git 認證來源。 |
UpdateGitCredentialsToNoneRequest
包含將 Git 認證更新為 none 的要求數據。
| 名稱 | 必要 | 類型 | Description |
|---|---|---|---|
| source | True |
string:
None |
Git 認證來源。 |
回應
| 名稱 | 類型 | Description |
|---|---|---|
| 200 OK | GitCredentialsConfigurationResponse: |
要求成功完成。 |
| Other Status Codes |
常見的錯誤碼:
|
範例
| Update user's Git credentials to Automatic example |
|
Update user's Git credentials to Configured |
| Update user's Git credentials to None example |
Update user's Git credentials to Automatic example
範例要求
PATCH https://api.fabric.microsoft.com/v1/workspaces/1565e6a3-c020-4c0c-dda7-92bafe99eec5/git/myGitCredentials
{
"source": "Automatic"
}
範例回覆
{
"source": "Automatic"
}
Update user's Git credentials to ConfiguredConnection example
範例要求
PATCH https://api.fabric.microsoft.com/v1/workspaces/1565e6a3-c020-4c0c-dda7-92bafe99eec5/git/myGitCredentials
{
"source": "ConfiguredConnection",
"connectionId": "3f2504e0-4f89-11d3-9a0c-0305e82c3301"
}
範例回覆
{
"source": "ConfiguredConnection",
"connectionId": "3f2504e0-4f89-11d3-9a0c-0305e82c3301"
}
Update user's Git credentials to None example
範例要求
PATCH https://api.fabric.microsoft.com/v1/workspaces/1565e6a3-c020-4c0c-dda7-92bafe99eec5/git/myGitCredentials
{
"source": "None"
}
範例回覆
{
"source": "None"
}
定義
| 名稱 | Description |
|---|---|
|
Automatic |
自動 Git 認證。 |
|
Configured |
已設定連線 Git 認證。 |
|
Error |
錯誤相關的資源詳細資料物件。 |
|
Error |
錯誤回應。 |
|
Error |
錯誤回應詳細數據。 |
|
Git |
Git 認證來源。 可能會隨著時間新增其他 Git 認證來源。 |
|
None |
未設定 Git 認證。 |
|
Update |
包含將 Git 認證更新為自動的要求數據。 |
|
Update |
包含將 Git 認證更新為已設定連線的要求數據。 |
|
Update |
包含將 Git 認證更新為 none 的要求數據。 |
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 認證來源。 |
UpdateGitCredentialsToAutomaticRequest
包含將 Git 認證更新為自動的要求數據。
| 名稱 | 類型 | Description |
|---|---|---|
| source |
string:
Automatic |
Git 認證來源。 |
UpdateGitCredentialsToConfiguredConnectionRequest
包含將 Git 認證更新為已設定連線的要求數據。
| 名稱 | 類型 | Description |
|---|---|---|
| connectionId |
string (uuid) |
連接的物件識別碼。 |
| source |
string:
Configured |
Git 認證來源。 |
UpdateGitCredentialsToNoneRequest
包含將 Git 認證更新為 none 的要求數據。
| 名稱 | 類型 | Description |
|---|---|---|
| source |
string:
None |
Git 認證來源。 |