Modifier

Partager via


Git - Update My Git Credentials

Updates the user's Git credentials configuration details.

Each user in the workspace has their own configured Git credentials. You can use Get My Git Credentials to get the Git credentials configuration.

Permissions

The caller must have a contributor or higher workspace role.

For configured connection Git credentials, the caller must have permission for the connection.

Required Delegated Scopes

Workspace.ReadWrite.All

Microsoft Entra supported identities

This API supports the Microsoft identities listed in this section.

Identity Support
User Yes
Service principal No
Managed identities No

Interface

PATCH https://api.fabric.microsoft.com/v1/workspaces/{workspaceId}/git/myGitCredentials

URI Parameters

Name In Required Type Description
workspaceId
path True

string

uuid

The workspace ID.

Request Body

The request body can be one of the following:

Name Description
UpdateGitCredentialsToAutomaticRequest

Contains the request data to update the Git credentials to automatic.

UpdateGitCredentialsToConfiguredConnectionRequest

Contains the request data to update the Git credentials to configured connection.

UpdateGitCredentialsToNoneRequest

Contains the request data to update the Git credentials to none.

UpdateGitCredentialsToAutomaticRequest

Contains the request data to update the Git credentials to automatic.

Name Required Type Description
source True string:

Automatic

The Git credentials source.

UpdateGitCredentialsToConfiguredConnectionRequest

Contains the request data to update the Git credentials to configured connection.

Name Required Type Description
connectionId True

string

The object ID of the connection.

source True string:

ConfiguredConnection

The Git credentials source.

UpdateGitCredentialsToNoneRequest

Contains the request data to update the Git credentials to none.

Name Required Type Description
source True string:

None

The Git credentials source.

Responses

Name Type Description
200 OK GitCredentialsConfigurationResponse:

Request completed successfully.

Other Status Codes

ErrorResponse

Common error codes:

  • UnknownError - An error occurred.

  • InsufficientPrivileges - Caller has insufficient workspace permissions.

  • WorkspaceNotConnectedToGit - Workspace is not connected to git.

  • ConnectionNotFound - The specified connection was not found.

  • ConnectionMismatch - The connection does not match the Git provider details.

Examples

Update user's Git credentials to ConfiguredConnection example
Update user's Git credentials to None example

Update user's Git credentials to ConfiguredConnection example

Sample request

PATCH https://api.fabric.microsoft.com/v1/workspaces/1565e6a3-c020-4c0c-dda7-92bafe99eec5/git/myGitCredentials

{
  "source": "ConfiguredConnection",
  "connectionId": "3f2504e0-4f89-11d3-9a0c-0305e82c3301"
}

Sample response

{
  "source": "ConfiguredConnection",
  "connectionId": "3f2504e0-4f89-11d3-9a0c-0305e82c3301"
}

Update user's Git credentials to None example

Sample request

PATCH https://api.fabric.microsoft.com/v1/workspaces/1565e6a3-c020-4c0c-dda7-92bafe99eec5/git/myGitCredentials

{
  "source": "None"
}

Sample response

{
  "source": "None"
}

Definitions

Name Description
AutomaticGitCredentialsResponse

Automatic Git credentials.

ConfiguredConnectionGitCredentialsResponse

Configured connection Git credentials.

ErrorRelatedResource

The error related resource details object.

ErrorResponse

The error response.

ErrorResponseDetails

The error response details.

GitCredentialsSource

The Git credentials source. Additional Git credentials sources may be added over time.

NoneGitCredentialsResponse

Not configured Git credentials.

UpdateGitCredentialsToAutomaticRequest

Contains the request data to update the Git credentials to automatic.

UpdateGitCredentialsToConfiguredConnectionRequest

Contains the request data to update the Git credentials to configured connection.

UpdateGitCredentialsToNoneRequest

Contains the request data to update the Git credentials to none.

AutomaticGitCredentialsResponse

Automatic Git credentials.

Name Type Description
source string:

Automatic

The Git credentials source.

ConfiguredConnectionGitCredentialsResponse

Configured connection Git credentials.

Name Type Description
connectionId

string

The object ID of the connection.

source string:

ConfiguredConnection

The Git credentials source.

ErrorRelatedResource

The error related resource details object.

Name Type Description
resourceId

string

The resource ID that's involved in the error.

resourceType

string

The type of the resource that's involved in the error.

ErrorResponse

The error response.

Name Type Description
errorCode

string

A specific identifier that provides information about an error condition, allowing for standardized communication between our service and its users.

message

string

A human readable representation of the error.

moreDetails

ErrorResponseDetails[]

List of additional error details.

relatedResource

ErrorRelatedResource

The error related resource details.

requestId

string

ID of the request associated with the error.

ErrorResponseDetails

The error response details.

Name Type Description
errorCode

string

A specific identifier that provides information about an error condition, allowing for standardized communication between our service and its users.

message

string

A human readable representation of the error.

relatedResource

ErrorRelatedResource

The error related resource details.

GitCredentialsSource

The Git credentials source. Additional Git credentials sources may be added over time.

Name Type Description
Automatic

string

The Git credentials are automatically obtained by the system, using default credentials if available.

ConfiguredConnection

string

The Git credentials are obtained through a configured connection.

None

string

The Git credentials are not configured.

NoneGitCredentialsResponse

Not configured Git credentials.

Name Type Description
source string:

None

The Git credentials source.

UpdateGitCredentialsToAutomaticRequest

Contains the request data to update the Git credentials to automatic.

Name Type Description
source string:

Automatic

The Git credentials source.

UpdateGitCredentialsToConfiguredConnectionRequest

Contains the request data to update the Git credentials to configured connection.

Name Type Description
connectionId

string

The object ID of the connection.

source string:

ConfiguredConnection

The Git credentials source.

UpdateGitCredentialsToNoneRequest

Contains the request data to update the Git credentials to none.

Name Type Description
source string:

None

The Git credentials source.