Modifier

Partager via


Git - Get My Git Credentials

Returns the user's Git credentials configuration details.

Indicates how the user's credentials are obtained for accessing the relevant Git provider, automatically or through configured connection. If the user's credentials aren't configured, go to Update My Git Credentials.

Permissions

The caller must have a contributor or higher workspace role.

Required Delegated Scopes

Workspace.Read.All or 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

GET 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.

Responses

Name Type Description
200 OK GitCredentialsConfigurationResponse:

Request completed successfully.

Other Status Codes

ErrorResponse

Common error codes:

  • UnknownError - An error occurred.

  • InsufficientPrivileges - The caller does not have sufficient workspace permissions.

  • WorkspaceNotConnectedToGit - Workspace is not connected to git.

Examples

Get the user's Git credentials configuration for Azure DevOps when it is automatic example
Get the user's Git credentials configuration for GitHub when it is configured by connection example
Get the user's Git credentials configuration for GitHub when it is not configured example

Get the user's Git credentials configuration for Azure DevOps when it is automatic example

Sample request

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

Sample response

{
  "source": "Automatic"
}

Get the user's Git credentials configuration for GitHub when it is configured by connection example

Sample request

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

Sample response

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

Get the user's Git credentials configuration for GitHub when it is not configured example

Sample request

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

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.

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.