Bewerken

Delen via


Git - Get Connection

Returns git connection details for the specified workspace.

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/connection

URI Parameters

Name In Required Type Description
workspaceId
path True

string

uuid

The workspace ID.

Responses

Name Type Description
200 OK

GitConnection

Request completed successfully.

Other Status Codes

ErrorResponse

Common error codes:

  • UnknownError - An error occurred.

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

Examples

Get Git connection details example
Workspace not connected to git example

Get Git connection details example

Sample request

GET https://api.fabric.microsoft.com/v1/workspaces/1455b6a2-c120-4c1c-dda7-92bafe99bec3/git/connection

Sample response

{
  "gitProviderDetails": {
    "organizationName": "Test Organization",
    "projectName": "Test Project",
    "gitProviderType": "AzureDevOps",
    "repositoryName": "Test Repo",
    "branchName": "Test Branch",
    "directoryName": ""
  },
  "gitSyncDetails": {
    "head": "eaa737b48cda41b37ffefac772ea48f6fed3eac4",
    "lastSyncTime": "2021-11-20T09:26:43.153"
  },
  "gitConnectionState": "ConnectedAndInitialized"
}

Workspace not connected to git example

Sample request

GET https://api.fabric.microsoft.com/v1/workspaces/1455b6a2-c120-4c1c-dda7-92bafe99bec3/git/connection

Sample response

{
  "gitProviderDetails": null,
  "gitSyncDetails": null,
  "gitConnectionState": "NotConnected"
}

Definitions

Name Description
AzureDevOpsDetails

Azure DevOps provider details.

ErrorRelatedResource

The error related resource details object.

ErrorResponse

The error response.

ErrorResponseDetails

The error response details.

GitConnection

Contains the Git connection details.

GitConnectionState

Git connection state. Additional connection state types may be added over time.

GitHubDetails

GitHub provider details.

GitProviderType

A Git provider type. Additional provider types may be added over time.

GitSyncDetails

Contains the sync details.

AzureDevOpsDetails

Azure DevOps provider details.

Name Type Description
branchName

string

The branch name. Maximum length is 250 characters.

directoryName

string

The relative path to the directory. Maximum length is 256 characters.

gitProviderType string:

AzureDevOps

A Git provider type. Additional provider types may be added over time.

organizationName

string

The organization name. Maximum length is 100 characters.

projectName

string

The project name. Maximum length is 100 characters.

repositoryName

string

The repository name. Maximum length is 128 characters.

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.

GitConnection

Contains the Git connection details.

Name Type Description
gitConnectionState

GitConnectionState

Git connection state. Additional connection state types may be added over time.

gitProviderDetails GitProviderDetails:

The Git provider details.

gitSyncDetails

GitSyncDetails

Contains the sync details.

GitConnectionState

Git connection state. Additional connection state types may be added over time.

Name Type Description
Connected

string

Connected state.

ConnectedAndInitialized

string

Connected and initialized state.

NotConnected

string

Not connected state.

GitHubDetails

GitHub provider details.

Name Type Description
branchName

string

The branch name. Maximum length is 250 characters.

directoryName

string

The relative path to the directory. Maximum length is 256 characters.

gitProviderType string:

GitHub

A Git provider type. Additional provider types may be added over time.

ownerName

string

The owner name. Maximum length is 100 characters.

repositoryName

string

The repository name. Maximum length is 128 characters.

GitProviderType

A Git provider type. Additional provider types may be added over time.

Name Type Description
AzureDevOps

string

Azure DevOps provider

GitHub

string

GitHub provider

GitSyncDetails

Contains the sync details.

Name Type Description
head

string

The full Secure Hash Algorithm 1 (SHA-1) of the synced commit ID.

lastSyncTime

string

The date and time of last sync state.