Edit

Items - Create Postgre SQL Database

Creates a PostgreSQL database in the specified workspace.

Note

PostgreSQLDatabase item is currently in Preview (learn more).

This API supports long running operations (LRO).

To create a PostgreSQL database with a definition, refer to the PostgreSQL database definition article.

Permissions

The caller must have a contributor workspace role.

Required Delegated Scopes

Item.ReadWrite.All

Required Tenant Settings

To use this API, enable the PostgreSQL database (preview) admin switch for the calling principal.

Limitations

  • To create a PostgreSQL database, the workspace must be on a supported Fabric capacity. For more information, see Microsoft Fabric license types.
  • The display name can't exceed 63 characters, including a display name supplied in the .platform part of the definition.

Microsoft Entra supported identities

This API supports the Microsoft identities listed in this section.

Identity Support
User Yes
Service principal and Managed identities Yes

Interface

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

URI Parameters

Name In Required Type Description
workspaceId
path True

string (uuid)

The workspace ID.

Request Body

Name Required Type Description
displayName True

string

maxLength: 63

The PostgreSQL database display name. The display name must follow naming rules according to item type and can't exceed 63 characters.

creationPayload

PostgreSQLDatabaseCreationPayload

The optional provisioning information for the PostgreSQL database. Use definition or creationPayload. You can't use both at the same time.

definition

PostgreSQLDatabaseDefinition

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

description

string

The PostgreSQL database description. Maximum length is 256 characters.

folderId

string (uuid)

The folder ID. If not specified or null, the PostgreSQL database is created with the workspace as its folder.

Responses

Name Type Description
201 Created

PostgreSQLDatabase

Successfully created.

202 Accepted

Request accepted, PostgreSQL database provisioning is in progress.


Headers:

Location string - The URL of the operation status, which can be used to track the operation state.

x-ms-operation-id string (uuid) - The operation ID which can be used with long running operations (LRO) APIs to track the operation state and get the result.

Retry-After integer - The number of seconds to wait before retrying the request.

429 Too Many Requests

ErrorResponse

The service rate limit was exceeded. The server returns a Retry-After header indicating, in seconds, how long the client must wait before sending additional requests.

Headers

Retry-After: integer

Other Status Codes

ErrorResponse

Common error codes:

  • InvalidItemType - Item type is invalid.

  • ItemDisplayNameAlreadyInUse - Item display name is already used.

  • InvalidItemDisplayName - Item display name is invalid.

  • CorruptedPayload - The provided payload is corrupted.

  • InvalidWorkloadPayload - The database creation payload is invalid.

Examples

Create a PostgreSQL database with a definition example
Create a PostgreSQL database with null origin metadata example
Create a PostgreSQL database with origin metadata example
Create a PostgreSQL database without a definition example

Create a PostgreSQL database with a definition example

Sample request

POST https://api.fabric.microsoft.com/v1/workspaces/11111111-2222-3333-4444-555555555555/postgreSQLDatabases

{
  "displayName": "SalesDb",
  "description": "Sales application database.",
  "definition": {
    "format": "pgschema",
    "parts": [
      {
        "path": "definition.pgschema",
        "payload": "UEsDBBQAAAAAAAAAISgN3c61pgAAAKYAAAANAAAAbWFuaWZlc3QuanNvbnsiJHNjaGVtYSI6Imh0dHBzOi8vZGV2ZWxvcGVyLm1pY3Jvc29mdC5jb20vanNvbi1zY2hlbWFzL2ZhYnJpYy9pdGVtL3Bvc3RncmVTUUxEYXRhYmFzZS9kZWZpbml0aW9uL21hbmlmZXN0LzEuMC4wL3NjaGVtYS5qc29uIiwiZm9ybWF0IjoicGdzY2hlbWEiLCJ2ZXJzaW9uIjoiMS4wLjAifQpQSwMEFAAAAAAAAAAhKABjSJNSAAAAUgAAAAgAAABtYWluLnNxbENSRUFURSBTQ0hFTUEgSUYgTk9UIEVYSVNUUyBzYWxlczsKXGkgdGFibGVzL29yZGVycy5zcWwKXGkgdmlld3Mvb3JkZXJfdG90YWxzLnNxbApQSwMEFAAAAAAAAAAhKJvoLSGkAAAApAAAABEAAAB0YWJsZXMvb3JkZXJzLnNxbENSRUFURSBUQUJMRSBzYWxlcy5vcmRlcnMgKAogICAgb3JkZXJfaWQgYmlnaW50IFBSSU1BUlkgS0VZLAogICAgY3VzdG9tZXJfaWQgYmlnaW50IE5PVCBOVUxMLAogICAgdG90YWxfYW1vdW50IG51bWVyaWMoMTIsIDIpIE5PVCBOVUxMIENIRUNLICh0b3RhbF9hbW91bnQgPj0gMCkKKTsKUEsDBBQAAAAAAAAAISijct55gAAAAIAAAAAWAAAAdmlld3Mvb3JkZXJfdG90YWxzLnNxbENSRUFURSBWSUVXIHNhbGVzLm9yZGVyX3RvdGFscyBBUwpTRUxFQ1QgY3VzdG9tZXJfaWQsIHN1bSh0b3RhbF9hbW91bnQpIEFTIHRvdGFsX2Ftb3VudApGUk9NIHNhbGVzLm9yZGVycwpHUk9VUCBCWSBjdXN0b21lcl9pZDsKUEsBAhQAFAAAAAAAAAAhKA3dzrWmAAAApgAAAA0AAAAAAAAAAAAAAAAAAAAAAG1hbmlmZXN0Lmpzb25QSwECFAAUAAAAAAAAACEoAGNIk1IAAABSAAAACAAAAAAAAAAAAAAAAADRAAAAbWFpbi5zcWxQSwECFAAUAAAAAAAAACEom+gtIaQAAACkAAAAEQAAAAAAAAAAAAAAAABJAQAAdGFibGVzL29yZGVycy5zcWxQSwECFAAUAAAAAAAAACEoo3LeeYAAAACAAAAAFgAAAAAAAAAAAAAAAAAcAgAAdmlld3Mvb3JkZXJfdG90YWxzLnNxbFBLBQYAAAAABAAEAPQAAADQAgAAAAA=",
        "payloadType": "InlineBase64"
      }
    ]
  }
}

Sample response

{
  "id": "aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee",
  "displayName": "SalesDb",
  "description": "Sales application database.",
  "type": "PostgreSQLDatabase",
  "workspaceId": "11111111-2222-3333-4444-555555555555",
  "properties": {
    "databaseName": "salesdb_a1b2c3",
    "serverFqdn": "salesdb-a1b2c3.postgres.fabric.microsoft.com"
  }
}
Location: https://api.fabric.microsoft.com/v1/operations/9bf413a7-b1eb-47c7-a682-35180bfe5c10
x-ms-operation-id: 9bf413a7-b1eb-47c7-a682-35180bfe5c10
Retry-After: 30

Create a PostgreSQL database with null origin metadata example

Sample request

POST https://api.fabric.microsoft.com/v1/workspaces/11111111-2222-3333-4444-555555555555/postgreSQLDatabases

{
  "displayName": "SalesDb",
  "description": "Sales application database.",
  "creationPayload": {
    "originatingProduct": null
  }
}

Sample response

{
  "id": "aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee",
  "displayName": "SalesDb",
  "description": "Sales application database.",
  "type": "PostgreSQLDatabase",
  "workspaceId": "11111111-2222-3333-4444-555555555555",
  "properties": {
    "databaseName": "salesdb_a1b2c3",
    "serverFqdn": "salesdb-a1b2c3.postgres.fabric.microsoft.com"
  }
}
Location: https://api.fabric.microsoft.com/v1/operations/9bf413a7-b1eb-47c7-a682-35180bfe5c10
x-ms-operation-id: 9bf413a7-b1eb-47c7-a682-35180bfe5c10
Retry-After: 30

Create a PostgreSQL database with origin metadata example

Sample request

POST https://api.fabric.microsoft.com/v1/workspaces/11111111-2222-3333-4444-555555555555/postgreSQLDatabases

{
  "displayName": "SalesDb",
  "description": "Sales application database.",
  "creationPayload": {
    "originatingProduct": "rayfin"
  }
}

Sample response

{
  "id": "aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee",
  "displayName": "SalesDb",
  "description": "Sales application database.",
  "type": "PostgreSQLDatabase",
  "workspaceId": "11111111-2222-3333-4444-555555555555",
  "properties": {
    "databaseName": "salesdb_a1b2c3",
    "serverFqdn": "salesdb-a1b2c3.postgres.fabric.microsoft.com"
  }
}
Location: https://api.fabric.microsoft.com/v1/operations/9bf413a7-b1eb-47c7-a682-35180bfe5c10
x-ms-operation-id: 9bf413a7-b1eb-47c7-a682-35180bfe5c10
Retry-After: 30

Create a PostgreSQL database without a definition example

Sample request

POST https://api.fabric.microsoft.com/v1/workspaces/11111111-2222-3333-4444-555555555555/postgreSQLDatabases

{
  "displayName": "SalesDb",
  "description": "Sales application database."
}

Sample response

{
  "id": "aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee",
  "displayName": "SalesDb",
  "description": "Sales application database.",
  "type": "PostgreSQLDatabase",
  "workspaceId": "11111111-2222-3333-4444-555555555555",
  "properties": {
    "databaseName": "salesdb_a1b2c3",
    "serverFqdn": "salesdb-a1b2c3.postgres.fabric.microsoft.com"
  }
}
Location: https://api.fabric.microsoft.com/v1/operations/9bf413a7-b1eb-47c7-a682-35180bfe5c10
x-ms-operation-id: 9bf413a7-b1eb-47c7-a682-35180bfe5c10
Retry-After: 30

Definitions

Name Description
CreatePostgreSQLDatabaseRequest

The request payload for creating a PostgreSQL database.

EntireTenantPrincipal

Represents a tenant principal

ErrorParameter

A structured parameter providing additional machine-readable context about an error.

ErrorRelatedResource

The error related resource details object.

ErrorResponse

The error response.

ErrorResponseDetails

The error response details.

GroupDetails

Group specific details. Applicable when the principal type is Group.

GroupPrincipal

Represents a security group.

GroupType

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

ItemTag

Represents a tag applied on an item.

ItemType

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

PayloadType

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

PostgreSQLDatabase

A PostgreSQL database object.

PostgreSQLDatabaseCreationPayload

The optional provisioning information for creating a PostgreSQL database.

PostgreSQLDatabaseDefinition

The PostgreSQL database public definition object in the pgschema format. Refer to this article for more details on the structure of the PostgreSQL database definition.

PostgreSqlDatabaseDefinitionFormat

The format of the PostgreSQL database definition. Additional format types may be added over time.

PostgreSQLDatabaseDefinitionPart

A PostgreSQL database definition part object.

PostgreSQLDatabaseProperties

The properties of a PostgreSQL database.

PrincipalType

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

SensitivityLabel

Represents a sensitivity label applied to an item.

ServicePrincipalDetails

Service principal specific details. Applicable when the principal type is ServicePrincipal.

ServicePrincipalPrincipal

Represents a Microsoft Entra service principal.

ServicePrincipalProfileDetails

Service principal profile details. Applicable when the principal type is ServicePrincipalProfile.

ServicePrincipalProfilePrincipal

Represents a service principal profile.

UserDetails

User principal specific details. Applicable when the principal type is User.

UserPrincipal

Represents a Microsoft Entra user principal.

CreatePostgreSQLDatabaseRequest

The request payload for creating a PostgreSQL database.

Name Type Description
creationPayload

PostgreSQLDatabaseCreationPayload

The optional provisioning information for the PostgreSQL database. Use definition or creationPayload. You can't use both at the same time.

definition

PostgreSQLDatabaseDefinition

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

description

string

The PostgreSQL database description. Maximum length is 256 characters.

displayName

string

maxLength: 63

The PostgreSQL database display name. The display name must follow naming rules according to item type and can't exceed 63 characters.

folderId

string (uuid)

The folder ID. If not specified or null, the PostgreSQL database is created with the workspace as its folder.

EntireTenantPrincipal

Represents a tenant principal

Name Type Description
displayName

string

The principal's display name.

id

string (uuid)

The principal's ID.

type string:

EntireTenant

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

ErrorParameter

A structured parameter providing additional machine-readable context about an error.

Name Type Description
message

string

A human-readable description of the parameter's meaning.

name

string

The parameter identifier.

value

string

The parameter value.

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.

isRetriable

boolean

When true, the request can be retried. Use the Retry-After response header to determine the delay, if available.

message

string

A human readable representation of the error.

moreDetails

ErrorResponseDetails[]

List of additional error details.

parameters

ErrorParameter[]

Structured parameters providing additional machine-readable context about the error.

relatedResource

ErrorRelatedResource

The error related resource details.

requestId

string (uuid)

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.

parameters

ErrorParameter[]

Structured parameters providing additional machine-readable context about the error.

relatedResource

ErrorRelatedResource

The error related resource details.

GroupDetails

Group specific details. Applicable when the principal type is Group.

Name Type Description
groupType

GroupType

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

GroupPrincipal

Represents a security group.

Name Type Description
displayName

string

The principal's display name.

groupDetails

GroupDetails

Group specific details. Applicable when the principal type is Group.

id

string (uuid)

The principal's ID.

type string:

Group

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

GroupType

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

Value Description
Unknown

Principal group type is unknown.

SecurityGroup

Principal is a security group.

DistributionList

Principal is a distribution list.

ItemTag

Represents a tag applied on an item.

Name Type Description
displayName

string

The name of the tag.

id

string (uuid)

The tag ID.

ItemType

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

Value Description
Dashboard

PowerBI dashboard.

Report

PowerBI report.

SemanticModel

PowerBI semantic model.

PaginatedReport

PowerBI paginated report.

Datamart

PowerBI datamart.

Lakehouse

A lakehouse.

Eventhouse

An eventhouse.

Environment

An environment.

KQLDatabase

A KQL database.

KQLQueryset

A KQL queryset.

KQLDashboard

A KQL dashboard.

DataPipeline

A data pipeline.

Notebook

A notebook.

SparkJobDefinition

A spark job definition.

MLExperiment

A machine learning experiment.

MLModel

A machine learning model.

Warehouse

A warehouse.

Eventstream

An eventstream.

SQLEndpoint

An SQL endpoint.

MirroredWarehouse

A mirrored warehouse.

MirroredDatabase

A mirrored database.

Reflex

A Reflex.

GraphQLApi

An API for GraphQL item.

MountedDataFactory

A MountedDataFactory.

SQLDatabase

A SQLDatabase.

CopyJob

A Copy job.

VariableLibrary

A VariableLibrary.

Dataflow

A Dataflow.

ApacheAirflowJob

An ApacheAirflowJob.

WarehouseSnapshot

A Warehouse snapshot.

DigitalTwinBuilder

A DigitalTwinBuilder.

DigitalTwinBuilderFlow

A Digital Twin Builder Flow.

MirroredAzureDatabricksCatalog

A mirrored azure databricks catalog.

Map

A Map.

AnomalyDetector

An Anomaly Detector.

UserDataFunction

A User Data Function.

GraphModel

A GraphModel.

GraphQuerySet

A Graph QuerySet.

SnowflakeDatabase

A Snowflake Database to store Iceberg tables created from Snowflake account.

OperationsAgent

A OperationsAgent.

CosmosDBDatabase

A Cosmos DB Database.

Ontology

An Ontology.

EventSchemaSet

An EventSchemaSet.

DataAgent

A DataAgent.

MirroredCatalog

A MirroredCatalog.

PolicySet

A PolicySet.

AppBackend

An AppBackend.

OrgApp

An Org App.

OrgAppAudience

An Org App Audience.

DataBuildToolJob

A DataBuildToolJob.

AzureDatabricksStorage

A OneLake-backed storage item for Azure Databricks.

Plan

A plan.

Monitoring

A Monitoring item.

DeploymentPlan

A Deployment plan.

ShareSubscription

A Share Subscription.

Share

A share.

Playbook

A Playbook.

MirroredOneLake

A mirrored OneLake item.

PostgreSQLDatabase

A PostgreSQL database item in Microsoft Fabric.

CustomStreamConnector

A Custom Stream Connector item in Microsoft Fabric.

PayloadType

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

Value Description
InlineBase64

Inline Base 64.

PostgreSQLDatabase

A PostgreSQL database object.

Name Type Description
defaultIdentity Principal:

The item's default identity.

description

string

The item description.

displayName

string

The item display name.

folderId

string (uuid)

The folder ID.

id

string (uuid)

The item ID.

logicalId

string (uuid)

The item's logical identifier. Corresponding item instances share the same logical ID. The value is null when no logical ID has been assigned.

properties

PostgreSQLDatabaseProperties

The PostgreSQL database properties.

sensitivityLabel

SensitivityLabel

The item sensitivity label.

tags

ItemTag[]

List of applied tags.

type

ItemType

The item type.

workspaceId

string (uuid)

The workspace ID.

PostgreSQLDatabaseCreationPayload

The optional provisioning information for creating a PostgreSQL database.

Name Type Description
originatingProduct

string

The caller-declared, unverified product that initiated database creation. This value is informational provisioning input only and is not an identity or authorization claim.

PostgreSQLDatabaseDefinition

The PostgreSQL database public definition object in the pgschema format. Refer to this article for more details on the structure of the PostgreSQL database definition.

Name Type Description
format

PostgreSqlDatabaseDefinitionFormat

The format of the PostgreSQL database definition. Additional format types may be added over time.

parts

PostgreSQLDatabaseDefinitionPart[]

A list containing exactly one required definition.pgschema workload part and an optional .platform metadata part.

PostgreSqlDatabaseDefinitionFormat

The format of the PostgreSQL database definition. Additional format types may be added over time.

Value Description
pgschema

The pgschema format for PostgreSQL database definitions.

PostgreSQLDatabaseDefinitionPart

A PostgreSQL database definition part object.

Name Type Description
path

string

The PostgreSQL database definition part path. The workload part path is definition.pgschema; an optional .platform part carries Fabric item metadata.

payload

string

The Base64-encoded PostgreSQL database definition part payload.

payloadType

PayloadType

The payload type.

PostgreSQLDatabaseProperties

The properties of a PostgreSQL database.

Name Type Description
databaseName

string

The service-assigned name of the underlying PostgreSQL database. This name is distinct from the item display name and is needed to connect.

serverFqdn

string

The fully qualified domain name (FQDN) of the server hosting the PostgreSQL database. This name is needed to connect.

PrincipalType

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

Value Description
User

Principal is a Microsoft Entra user principal.

ServicePrincipal

Principal is a Microsoft Entra service principal.

Group

Principal is a security group.

ServicePrincipalProfile

Principal is a service principal profile.

EntireTenant

Principal represents all tenant users.

SensitivityLabel

Represents a sensitivity label applied to an item.

Name Type Description
id

string (uuid)

The sensitivity label ID.

ServicePrincipalDetails

Service principal specific details. Applicable when the principal type is ServicePrincipal.

Name Type Description
aadAppId

string (uuid)

The service principal's Microsoft Entra AppId.

ServicePrincipalPrincipal

Represents a Microsoft Entra service principal.

Name Type Description
displayName

string

The principal's display name.

id

string (uuid)

The principal's ID.

servicePrincipalDetails

ServicePrincipalDetails

Service principal specific details. Applicable when the principal type is ServicePrincipal.

type string:

ServicePrincipal

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

ServicePrincipalProfileDetails

Service principal profile details. Applicable when the principal type is ServicePrincipalProfile.

Name Type Description
parentPrincipal Principal:

The service principal profile's parent principal.

ServicePrincipalProfilePrincipal

Represents a service principal profile.

Name Type Description
displayName

string

The principal's display name.

id

string (uuid)

The principal's ID.

servicePrincipalProfileDetails

ServicePrincipalProfileDetails

Service principal profile details. Applicable when the principal type is ServicePrincipalProfile.

type string:

ServicePrincipalProfile

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

UserDetails

User principal specific details. Applicable when the principal type is User.

Name Type Description
userPrincipalName

string

The user principal name.

UserPrincipal

Represents a Microsoft Entra user principal.

Name Type Description
displayName

string

The principal's display name.

id

string (uuid)

The principal's ID.

type string:

User

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

userDetails

UserDetails

User principal specific details. Applicable when the principal type is User.