Git - Initialize Connection

Initialize a connection for a workspace that's connected to Git.

This API supports long running operations (LRO).

This API should be called after a successful call to the Connect API. To complete a full sync of the workspace, use the Required Action operation to call the relevant sync operation, either Commit To Git or Update From Git.

Permissions

The caller must have an admin workspace role.

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

POST https://api.fabric.microsoft.com/v1/workspaces/{workspaceId}/git/initializeConnection

URI Parameters

Name In Required Type Description
workspaceId
path True

string

uuid

The workspace ID.

Request Body

Name Type Description
initializationStrategy

InitializationStrategy

The strategy required for an initialization process when content exists on both the remote side and the workspace side. Additional strategies may be added over time.

Responses

Name Type Description
200 OK

InitializeGitConnectionResponse

Request completed successfully.

202 Accepted

Request accepted, initialize connection in progress.

Headers

  • Location: string
  • x-ms-operation-id: string
  • Retry-After: integer
Other Status Codes

ErrorResponse

Common error codes:

  • WorkspaceNotConnectedToGit - Workspace is not connected to git.

  • WorkspaceHasNoCapacityAssigned - No capacity assigned to Workspace.

  • MissingInitializationPolicy - Initialization policy is missing.

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

Examples

Initialize the connection of a workspace connected to a Git example

Sample request

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

Sample response

{
  "requiredAction": "UpdateFromGit",
  "workspaceHead": "eaa737b48cda41b37ffefac772ea48f6fed3eac4",
  "remoteCommitHash": "7d03b2918bf6aa62f96d0a4307293f3853201705"
}
Location: https://api.fabric.microsoft.com/v1/operations/431e8d7b-4a95-4c02-8ccd-6faef5ba1bd7
x-ms-operation-id: 431e8d7b-4a95-4c02-8ccd-6faef5ba1bd7
Retry-After: 30

Definitions

Name Description
ErrorRelatedResource

The error related resource details object.

ErrorResponse

The error response.

ErrorResponseDetails

The error response details.

InitializationStrategy

The strategy required for an initialization process when content exists on both the remote side and the workspace side. Additional strategies may be added over time.

InitializeGitConnectionRequest

Contains the initialize Git connection request data.

InitializeGitConnectionResponse

Contains the initialize Git connection response data.

RequiredAction

Required action after the initialization process has finished. Additional actions may be added over time.

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.

InitializationStrategy

The strategy required for an initialization process when content exists on both the remote side and the workspace side. Additional strategies may be added over time.

Name Type Description
None

string

No strategy defined.

PreferRemote

string

Prefer remote Git side content.

PreferWorkspace

string

Prefer workspace side content.

InitializeGitConnectionRequest

Contains the initialize Git connection request data.

Name Type Description
initializationStrategy

InitializationStrategy

The strategy required for an initialization process when content exists on both the remote side and the workspace side. Additional strategies may be added over time.

InitializeGitConnectionResponse

Contains the initialize Git connection response data.

Name Type Description
remoteCommitHash

string

Remote full SHA commit hash.

requiredAction

RequiredAction

Required action after the initialization process has finished. Additional actions may be added over time.

workspaceHead

string

Full SHA hash that the workspace is synced to.

RequiredAction

Required action after the initialization process has finished. Additional actions may be added over time.

Name Type Description
CommitToGit

string

Commit to Git is required.

None

string

No action is required.

UpdateFromGit

string

Update from Git is required.