Editar

Compartilhar via


Items - Create KQL Database

Creates a KQL database in the specified workspace.
This API supports long running operations (LRO).

Permissions

The caller must have contributor or higher workspace role.

Required Delegated Scopes

KQLDatabase.ReadWrite.All or Item.ReadWrite.All

Limitations

Microsoft Entra supported identities

This API supports the Microsoft identities listed in this section.

Identity Support
User Yes
Service principal Yes
Managed identities Yes

Interface

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

URI Parameters

Name In Required Type Description
workspaceId
path True

string

uuid

The workspace ID.

Request Body

Name Required Type Description
displayName True

string

The KQL database display name. The database name can contain alphanumeric characters, underscores, periods, and hyphens. Special characters aren't supported.

creationPayload KQLDatabaseCreationPayload:

The KQL database creation payload. Use definition or creationPayload. You can't use both at the same time.

definition

KQLDatabaseDefinition

The KQL database public definition. Use creationPayload or definition. You can't use both at the same time.

description

string

The KQL database description. Maximum length is 256 characters.

Responses

Name Type Description
201 Created

KQLDatabase

Successfully created

202 Accepted

Request accepted, KQL database provisioning in progress

Headers

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

ErrorResponse

Common error codes:

  • InvalidItemType - Item type is invalid

  • ItemDisplayNameAlreadyInUse - Item display name is already used

  • CorruptedPayload - The provided payload is corrupted.

Examples

Create a ReadWrite KQL database example
Create a ReadWrite KQL database with definition example
Create a Shortcut KQL database to source Azure Data Explorer cluster example
Create a Shortcut KQL database to source Azure Data Explorer cluster with invitation token example
Create a Shortcut KQL database to source KQL database example

Create a ReadWrite KQL database example

Sample request

POST https://api.fabric.microsoft.com/v1/workspaces/cfafbeb1-8037-4d0c-896e-a46fb27ff229/kqlDatabases

{
  "displayName": "KQLDatabase_1",
  "description": "A KQL database description.",
  "creationPayload": {
    "databaseType": "ReadWrite",
    "parentEventhouseItemId": "5b218778-e7a5-4d73-8187-f10824047836"
  }
}

Sample response

Location: https://api.fabric.microsoft.com/v1/operations/0acd697c-1550-43cd-b998-91bfbfbd47c6
x-ms-operation-id: 0acd697c-1550-43cd-b998-91bfbfbd47c6
Retry-After: 30

Create a ReadWrite KQL database with definition example

Sample request

POST https://api.fabric.microsoft.com/v1/workspaces/cfafbeb1-8037-4d0c-896e-a46fb27ff229/kqlDatabases

{
  "displayName": "KQLDatabase_1",
  "description": "A KQL database description.",
  "definition": {
    "parts": [
      {
        "path": "DatabaseProperties.json",
        "payload": "ewogICJkYXRhYmFzZVR5cGUiOiAiUmVhZFdyaXRlIiwKICAicGFyZW50RXZlbnRob3VzZUl0ZW1JZCI6ICI1YjIxODc3OC1lN2E1LTRkNzMtODE4Ny1mMTA4MjQwNDc4MzYiLAogICJvbmVMYWtlQ2FjaGluZ1BlcmlvZCI6ICJQMzY1MDBEIiwKICAib25lTGFrZVN0YW5kYXJkU3RvcmFnZVBlcmlvZCI6ICJQMzY1MDBEIgp9",
        "payloadType": "InlineBase64"
      },
      {
        "path": "DatabaseSchema.kql",
        "payload": "Ly8gS1FMIHNjcmlwdAovLyBVc2UgbWFuYWdlbWVudCBjb21tYW5kcyBpbiB0aGlzIHNjcmlwdCB0byBjb25maWd1cmUgeW91ciBkYXRhYmFzZSBpdGVtcywgc3VjaCBhcyB0YWJsZXMsIGZ1bmN0aW9ucywgbWF0ZXJpYWxpemVkIHZpZXdzLCBhbmQgbW9yZS4KCi5jcmVhdGUtbWVyZ2UgdGFibGUgTXlMb2dzIChMZXZlbDpzdHJpbmcsIFRpbWVzdGFtcDpkYXRldGltZSwgVXNlcklkOnN0cmluZywgVHJhY2VJZDpzdHJpbmcsIE1lc3NhZ2U6c3RyaW5nLCBQcm9jZXNzSWQ6aW50KQ==",
        "payloadType": "InlineBase64"
      },
      {
        "path": ".platform",
        "payload": "ZG90UGxhdGZvcm1CYXNlNjRTdHJpbmc=",
        "payloadType": "InlineBase64"
      }
    ]
  }
}

Sample response

{
  "displayName": "KQLDatabase_1",
  "description": "A KQL database description.",
  "type": "KQLDatabase",
  "workspaceId": "cfafbeb1-8037-4d0c-896e-a46fb27ff229",
  "id": "5b218778-e7a5-4d73-8187-f10824047651"
}
Location: https://api.fabric.microsoft.com/v1/operations/0acd697c-1550-43cd-b998-91bfbfbd47c6
x-ms-operation-id: 0acd697c-1550-43cd-b998-91bfbfbd47c6
Retry-After: 30

Create a Shortcut KQL database to source Azure Data Explorer cluster example

Sample request

POST https://api.fabric.microsoft.com/v1/workspaces/cfafbeb1-8037-4d0c-896e-a46fb27ff229/kqlDatabases

{
  "displayName": "KQLDatabase_1",
  "description": "A KQL database description.",
  "creationPayload": {
    "databaseType": "Shortcut",
    "parentEventhouseItemId": "5b218778-e7a5-4d73-8187-f10824047836",
    "sourceClusterUri": "https://adxcluster.westus.kusto.windows.net",
    "sourceDatabaseName": "MyDatabase"
  }
}

Sample response

{
  "displayName": "KQLDatabase_1",
  "description": "A KQL database description.",
  "type": "KQLDatabase",
  "workspaceId": "cfafbeb1-8037-4d0c-896e-a46fb27ff229",
  "id": "5b218778-e7a5-4d73-8187-f10824047653"
}
Location: https://api.fabric.microsoft.com/v1/operations/0acd697c-1550-43cd-b998-91bfbfbd47c6
x-ms-operation-id: 0acd697c-1550-43cd-b998-91bfbfbd47c6
Retry-After: 30

Create a Shortcut KQL database to source Azure Data Explorer cluster with invitation token example

Sample request

POST https://api.fabric.microsoft.com/v1/workspaces/cfafbeb1-8037-4d0c-896e-a46fb27ff229/kqlDatabases

{
  "displayName": "KQLDatabase_1",
  "description": "A KQL database description.",
  "creationPayload": {
    "databaseType": "Shortcut",
    "parentEventhouseItemId": "5b218778-e7a5-4d73-8187-f10824047836",
    "invitationToken": "eyJ0eXAiOiJKVInvitationToken"
  }
}

Sample response

{
  "displayName": "KQLDatabase_1",
  "description": "A KQL database description.",
  "type": "KQLDatabase",
  "workspaceId": "cfafbeb1-8037-4d0c-896e-a46fb27ff229",
  "id": "5b218778-e7a5-4d73-8187-f10824047654"
}
Location: https://api.fabric.microsoft.com/v1/operations/0acd697c-1550-43cd-b998-91bfbfbd47c6
x-ms-operation-id: 0acd697c-1550-43cd-b998-91bfbfbd47c6
Retry-After: 30

Create a Shortcut KQL database to source KQL database example

Sample request

POST https://api.fabric.microsoft.com/v1/workspaces/cfafbeb1-8037-4d0c-896e-a46fb27ff229/kqlDatabases

{
  "displayName": "KQLDatabase_1",
  "description": "A KQL database description.",
  "creationPayload": {
    "databaseType": "Shortcut",
    "parentEventhouseItemId": "5b218778-e7a5-4d73-8187-f10824047836",
    "sourceDatabaseName": "ac542109-abd1-4ee3-aec5-86282c01ee24"
  }
}

Sample response

{
  "displayName": "KQLDatabase_1",
  "description": "A KQL database description.",
  "type": "KQLDatabase",
  "workspaceId": "cfafbeb1-8037-4d0c-896e-a46fb27ff229",
  "id": "5b218778-e7a5-4d73-8187-f10824047652"
}
Location: https://api.fabric.microsoft.com/v1/operations/0acd697c-1550-43cd-b998-91bfbfbd47c6
x-ms-operation-id: 0acd697c-1550-43cd-b998-91bfbfbd47c6
Retry-After: 30

Definitions

Name Description
CreateKQLDatabaseRequest

Create KQL database request payload.

ErrorRelatedResource

The error related resource details object.

ErrorResponse

The error response.

ErrorResponseDetails

The error response details.

ItemType

The type of the item. Additional item types may be added over time.

KQLDatabase

A KQL database object.

KQLDatabaseDefinition

KQL database public definition object.

KQLDatabaseDefinitionPart

KQL database definition part object.

KQLDatabaseProperties

The KQL database properties.

KqlDatabaseType

The type of the database.

PayloadType

The type of the definition part payload. Additional payload types may be added over time.

ReadWriteDatabaseCreationPayload

ReadWrite KQL database item creation payload

ShortcutDatabaseCreationPayload

Shortcut KQL database item creation payload

CreateKQLDatabaseRequest

Create KQL database request payload.

Name Type Description
creationPayload KQLDatabaseCreationPayload:

The KQL database creation payload. Use definition or creationPayload. You can't use both at the same time.

definition

KQLDatabaseDefinition

The KQL database public definition. Use creationPayload or definition. You can't use both at the same time.

description

string

The KQL database description. Maximum length is 256 characters.

displayName

string

The KQL database display name. The database name can contain alphanumeric characters, underscores, periods, and hyphens. Special characters aren't supported.

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.

ItemType

The type of the item. Additional item types may be added over time.

Name Type Description
Dashboard

string

PowerBI dashboard.

DataPipeline

string

A data pipeline.

Datamart

string

PowerBI datamart.

Environment

string

An environment.

Eventhouse

string

An eventhouse.

Eventstream

string

An eventstream.

KQLDashboard

string

A KQL dashboard.

KQLDatabase

string

A KQL database.

KQLQueryset

string

A KQL queryset.

Lakehouse

string

A lakehouse.

MLExperiment

string

A machine learning experiment.

MLModel

string

A machine learning model.

MirroredDatabase

string

A mirrored database.

MirroredWarehouse

string

A mirrored warehouse.

Notebook

string

A notebook.

PaginatedReport

string

PowerBI paginated report.

Reflex

string

A Reflex.

Report

string

PowerBI report.

SQLEndpoint

string

An SQL endpoint.

SemanticModel

string

PowerBI semantic model.

SparkJobDefinition

string

A spark job definition.

Warehouse

string

A warehouse.

KQLDatabase

A KQL database object.

Name Type Description
description

string

The item description.

displayName

string

The item display name.

id

string

The item ID.

properties

KQLDatabaseProperties

The KQL database properties.

type

ItemType

The item type.

workspaceId

string

The workspace ID.

KQLDatabaseDefinition

KQL database public definition object.

Name Type Description
format

string

The format of the item definition.

parts

KQLDatabaseDefinitionPart[]

A list of definition parts.

KQLDatabaseDefinitionPart

KQL database definition part object.

Name Type Description
path

string

The KQL database part path.

payload

string

The KQL database part payload.

payloadType

PayloadType

The payload type.

KQLDatabaseProperties

The KQL database properties.

Name Type Description
databaseType

KqlDatabaseType

The type of the database.

ingestionServiceUri

string

Ingestion service URI.

parentEventhouseItemId

string

Parent eventhouse ID.

queryServiceUri

string

Query service URI.

KqlDatabaseType

The type of the database.

Name Type Description
ReadWrite

string

Allows read and write operations on the database.

Shortcut

string

A shortcut is an embedded reference allowing read only operations on a source database. The source can be in the same or different tenants, either in an Azure Data Explorer cluster or a Fabric Eventhouse.

PayloadType

The type of the definition part payload. Additional payload types may be added over time.

Name Type Description
InlineBase64

string

Inline Base 64.

ReadWriteDatabaseCreationPayload

ReadWrite KQL database item creation payload

Name Type Description
databaseType string:

ReadWrite

The type of the KQL database

parentEventhouseItemId

string

Parent eventhouse item ID.

ShortcutDatabaseCreationPayload

Shortcut KQL database item creation payload

Name Type Description
databaseType string:

Shortcut

The type of the KQL database

invitationToken

string

Invitation token to follow the source database

parentEventhouseItemId

string

Parent eventhouse item ID.

sourceClusterUri

string

The URI of the source Eventhouse or Azure Data Explorer cluster

sourceDatabaseName

string

The name of the database to follow in the source Eventhouse or Azure Data Explorer cluster.