OneLake Shortcuts - Create Shortcut

Note

This API is in preview.

Creates a new shortcut.

Required Delegated Scopes

OneLake.ReadWrite.All

Interface

POST https://api.fabric.microsoft.com/v1/workspaces/{workspaceId}/items/{itemId}/shortcuts
POST https://api.fabric.microsoft.com/v1/workspaces/{workspaceId}/items/{itemId}/shortcuts?shortcutConflictPolicy={shortcutConflictPolicy}

URI Parameters

Name In Required Type Description
itemId
path True

string

uuid

The ID of the data item.

workspaceId
path True

string

uuid

The ID of the workspace.

shortcutConflictPolicy
query

ShortcutConflictPolicy

When provided, it defines the action to take when a shortcut with the same name and path already exists. The default action is 'Abort'. Additional ShortcutConflictPolicy types may be added over time.

Request Body

Name Required Type Description
name True

string

Name of the Shortcut.

path True

string

A string representing the full path where the shortcut will be created, including either "Files" or "Tables".

target True

Target

The object contains properties for the target datasource, and it must specify exactly one of the supported destinations: OneLake, S3, ADLS, or Dataverse.

Responses

Name Type Description
201 Created

Shortcut

Successfully created.

Headers

Location: string

Other Status Codes

ErrorResponse

Common error codes:

  • ItemNotFound - Indicates that the server cannot find the requested item

  • UnknownError - An error occurred

Examples

Create shortcut AdlsGen2 target example
Create shortcut AmazonS3 target example
Create shortcut One Lake target example

Create shortcut AdlsGen2 target example

Sample Request

POST https://api.fabric.microsoft.com/v1/workspaces/cfafbeb1-8037-4d0c-896e-a46fb27ff222/items/25bac802-080d-4f73-8a42-1b406eb1fceb/shortcuts

{
  "path": "Files/landingZone",
  "name": "PartnerProducts",
  "target": {
    "adlsGen2": {
      "location": "https://contosoadlsaccount.dfs.core.windows.net",
      "subpath": "/mycontainer/data/ContosoProducts",
      "connectionId": "91324db9-8dc4-4730-a1e5-bafabf1fb91e"
    }
  }
}

Sample Response

Location: https://api.fabric.microsoft.com/v1/workspaces/cfafbeb1-8037-4d0c-896e-a46fb27ff222/items/25bac802-080d-4f73-8a42-1b406eb1fceb/shortcuts/Files/landingZone/PartnerProducts
{
  "path": "Files/landingZone",
  "name": "PartnerProducts",
  "target": {
    "adlsGen2": {
      "location": "https://contosoadlsaccount.dfs.core.windows.net",
      "subpath": "/mycontainer/data/ContosoProducts",
      "connectionId": "91324db9-8dc4-4730-a1e5-bafabf1fb91e"
    }
  }
}

Create shortcut AmazonS3 target example

Sample Request

POST https://api.fabric.microsoft.com/v1/workspaces/cfafbeb1-8037-4d0c-896e-a46fb27ff222/items/25bac802-080d-4f73-8a42-1b406eb1fceb/shortcuts

{
  "path": "Files/landingZone",
  "name": "PartnerEmployees",
  "target": {
    "amazonS3": {
      "location": "https://my-s3-bucket.s3.us-west-2.amazonaws.com",
      "subpath": "/data/ContosoEmployees",
      "connectionId": "cf480513-2c1c-46b2-958a-42556ee584c3"
    }
  }
}

Sample Response

Location: https://api.fabric.microsoft.com/v1/workspaces/cfafbeb1-8037-4d0c-896e-a46fb27ff222/items/25bac802-080d-4f73-8a42-1b406eb1fceb/shortcuts/Files/landingZone/PartnerEmployees
{
  "path": "Files/landingZone",
  "name": "PartnerEmployees",
  "target": {
    "amazonS3": {
      "location": "https://my-s3-bucket.s3.us-west-2.amazonaws.com",
      "subpath": "/data/ContosoEmployees",
      "connectionId": "cf480513-2c1c-46b2-958a-42556ee584c3"
    }
  }
}

Create shortcut One Lake target example

Sample Request

POST https://api.fabric.microsoft.com/v1/workspaces/cfafbeb1-8037-4d0c-896e-a46fb27ff222/items/25bac802-080d-4f73-8a42-1b406eb1fceb/shortcuts

{
  "path": "Files/blafolder/folder3",
  "name": "MyOneLakeShortcut",
  "target": {
    "oneLake": {
      "workspaceId": "acafbeb1-8037-4d0c-896e-a46fb27ff256",
      "itemId": "56bac802-080d-4f73-8a42-1b406eb1fcac",
      "path": "Tables/myTablesFolder/someTableSubFolder"
    }
  }
}

Sample Response

Location: https://api.fabric.microsoft.com/v1/workspaces/cfafbeb1-8037-4d0c-896e-a46fb27ff222/items/25bac802-080d-4f73-8a42-1b406eb1fceb/shortcuts/Files/blafolder/folder3/MyOneLakeShortcut
{
  "path": "Files/blafolder/folder3",
  "name": "MyOneLakeShortcut",
  "target": {
    "oneLake": {
      "workspaceId": "acafbeb1-8037-4d0c-896e-a46fb27ff256",
      "itemId": "56bac802-080d-4f73-8a42-1b406eb1fcac",
      "path": "Tables/myTablesFolder/someTableSubFolder"
    }
  }
}

Definitions

Name Description
AdlsGen2

An object containing the properties for the target datasource in ADLS.

AmazonS3

An object containing the properties for the target datasource in Amazon S3.

CreateShortcutRequest

A shortcut creation request with an object representing a reference to another storage location.

Dataverse

An object containing the properties for the target datasource in Dataverse.

ErrorRelatedResource

The error related resource details object.

ErrorResponse

The error response.

ErrorResponseDetails

The error response details.

OneLake

An object containing the properties for the target datasource in OneLake.

Shortcut

An object representing a reference that points to other storage locations which can be internal or external to OneLake. Shortcut is defined by name, path where the shortcut will be created and target specifying the target storage location.

ShortcutConflictPolicy

When provided, it defines the action to take when a shortcut with the same name and path already exists. The default action is 'Abort'. Additional ShortcutConflictPolicy types may be added over time.

Target

The object contains properties for the target datasource, and must specify exactly one of the supported destinations as described in the table below.

AdlsGen2

An object containing the properties for the target datasource in ADLS.

Name Type Description
connectionId

string

A string representing the Connection that is bound with the Shortcut. The ConnectionId is a unique identifier which allows to establish a connection between the shortcut and the target datasource. To find this connection ID, first create a cloud connection to be used by the shortcut when connecting to the ADLS data location. Open the cloud connection's Settings view and copy the connection ID; this is a GUID.

location

string

Specifies the location of the target ADLS container. The URI must be in the format https://[account-name].dfs.core.windows.net where [account-name] is the name of the target ADLS account.

subpath

string

Specifies the container and subfolder within the ADLS account where the target folder is located. Must be of the format [container]/[subfolder] where [container] is the name of the container that holds the files and folders; [subfolder] is the name of the subfolder within the container (optional).
Example: /mycontainer/mysubfolder

AmazonS3

An object containing the properties for the target datasource in Amazon S3.

Name Type Description
connectionId

string

A string representing the Connection that is bound with the Shortcut. The ConnectionId is a unique identifier which allows to establish a connection between the shortcut and the target datasource. To find this connection ID, first create a cloud connection to be used by the shortcut when connecting to the Amazon S3 data location. Open the cloud connection's Settings view and copy the connection ID; this is a GUID.

location

string

HTTP URL that points to the target bucket in S3. The URL should be in the format https://[bucket-name].s3.[region-code].amazonaws.com, where "bucket-name" is the name of the S3 bucket you want to point to, and "region-code" is the code for the region where the bucket is located.
Example: https://my-s3-bucket.s3.us-west-2.amazonaws.com

subpath

string

Specifies a target folder or subfolder within the S3 bucket.

CreateShortcutRequest

A shortcut creation request with an object representing a reference to another storage location.

Name Type Description
name

string

Name of the Shortcut.

path

string

A string representing the full path where the shortcut will be created, including either "Files" or "Tables".

target

Target

The object contains properties for the target datasource, and it must specify exactly one of the supported destinations: OneLake, S3, ADLS, or Dataverse.

Dataverse

An object containing the properties for the target datasource in Dataverse.

Name Type Description
connectionId

string

A string representing the Connection that is bound with the Shortcut. The ConnectionId is a unique identifier which allows to establish a connection between the shortcut and the target datasource. To find this connection ID, first create a cloud connection to be used by the shortcut when connecting to the Dataverse data location. Open the cloud connection's Settings view and copy the connection ID; this is a GUID.

deltaLakeFolder

string

Specifies the DeltaLake folder path where the target data is stored.

environmentDomain

string

URI that indicates the Dataverse target environment's domain name. The URI should be formatted as "https://[orgname].crm[xx].dynamics.com", where [orgname] represents the name of your Dataverse organization.

tableName

string

Specifies the name of the target table in Dataverse

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.

OneLake

An object containing the properties for the target datasource in OneLake.

Name Type Description
itemId

string

The ID of the target in OneLake. The target can be an item of Lakehouse, KQLDatabase, or Warehouse.

path

string

A string representing the full path to the target folder within the Item. This path should be relative to the root of the OneLake directory structure.
Example: "Tables/myTablesFolder/someTableSubFolder".

workspaceId

string

The ID of the target workspace.

Shortcut

An object representing a reference that points to other storage locations which can be internal or external to OneLake. Shortcut is defined by name, path where the shortcut will be created and target specifying the target storage location.

Name Type Description
name

string

Name of the Shortcut.

path

string

A string representing the full path where the shortcut will be created, including either "Files" or "Tables".

target

Target

The object contains properties for the target datasource, and must specify exactly one of the supported destinations.

ShortcutConflictPolicy

When provided, it defines the action to take when a shortcut with the same name and path already exists. The default action is 'Abort'. Additional ShortcutConflictPolicy types may be added over time.

Name Type Description
Abort

string

When a shortcut with the same name and path already exists, the shortcut creation will be cancelled.

GenerateUniqueName

string

When a shortcut with the same name and path already exists, the shortcut creation will continue with a new, unique shortcut name.

Target

The object contains properties for the target datasource, and must specify exactly one of the supported destinations as described in the table below.

Name Type Description
adlsGen2

AdlsGen2

An object containing the properties for the target datasource in ADLS.

amazonS3

AmazonS3

An object containing the properties for the target datasource in Amazon S3.

dataverse

Dataverse

An object containing the properties for the target datasource in Dataverse.

oneLake

OneLake

An object containing the properties for the target datasource in OneLake.