Edit

Share via


OneLake Settings - Modify Diagnostics

Enables or disables workspace OneLake diagnostic settings.
This API supports long running operations (LRO).

Permissions

  • The caller must have an admin workspace role on the source workspace.

  • The caller must have contributor or above workspace role on the destination workspace.

Required Delegated Scopes

OneLake.ReadWrite.All

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}/onelake/settings/modifyDiagnostics

URI Parameters

Name In Required Type Description
workspaceId
path True

string (uuid)

The workspace ID.

Request Body

Name Required Type Description
status True

string

The status of the diagnostics settings.

destination OneLakeDiagnosticSettingsDestinationInfo:

LakehouseOneLakeDiagnosticSettingsDestination

The destination where OneLake diagnostic logs are stored. If disabling, this is not required.

Responses

Name Type Description
200 OK

Request completed successfully.

202 Accepted

Request accepted. Modify diagnostic settings is in progress.

Headers

  • Location: string
  • x-ms-operation-id: string
  • Retry-After: integer
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:

  • UnknownError - An error occurred.

  • WorkspaceNotFound - Source Workspace not found.

  • UserNotAuthorizedSourceWorkspace - User is not authorized for the source workspace.

  • UserNotAuthorizedDestinationItem - User is not authorized for the destination workspace.

  • DestinationWorkspaceNotFound - Destination Workspace not found.

  • DestinationItemNotFound -Destination item not found.

  • WorkspaceNotInSameCapacity - Source and destination workspace not in same capacity.

  • SettingsNotAllowedOnWorkspace - Diagnostic setting not allowed on workspace.

  • RequiredDestination - Destination is required when enabling diagnostics for first time.

Examples

Create OneLake Diagnostic Setting for Workspace example
Disable OneLake Diagnostic Setting for Workspace example
Remove OneLake Diagnostic Setting Destination for Workspace example
Replace OneLake Diagnostic Setting Destination for Workspace example

Create OneLake Diagnostic Setting for Workspace example

Sample request

POST https://api.fabric.microsoft.com/v1/workspaces/cfafbeb1-8037-4d0c-896e-a46fb27ff227/onelake/settings/modifyDiagnostics

{
  "status": "Enabled",
  "destination": {
    "type": "Lakehouse",
    "lakehouse": {
      "referenceType": "ById",
      "itemId": "eceb53c6-6227-41f1-a649-62ebe7ee9eb1",
      "workspaceId": "85173301-af01-49c9-b667-03edc44517da"
    }
  }
}

Sample response

Disable OneLake Diagnostic Setting for Workspace example

Sample request

POST https://api.fabric.microsoft.com/v1/workspaces/cfafbeb1-8037-4d0c-896e-a46fb27ff227/onelake/settings/modifyDiagnostics

{
  "status": "Disabled"
}

Sample response

Remove OneLake Diagnostic Setting Destination for Workspace example

Sample request

POST https://api.fabric.microsoft.com/v1/workspaces/cfafbeb1-8037-4d0c-896e-a46fb27ff227/onelake/settings/modifyDiagnostics

{
  "status": "Disabled",
  "destination": {
    "type": "Lakehouse"
  }
}

Sample response

Replace OneLake Diagnostic Setting Destination for Workspace example

Sample request

POST https://api.fabric.microsoft.com/v1/workspaces/cfafbeb1-8037-4d0c-896e-a46fb27ff227/onelake/settings/modifyDiagnostics

{
  "status": "Enabled",
  "destination": {
    "type": "Lakehouse",
    "lakehouse": {
      "referenceType": "ById",
      "itemId": "83b128a3-f58f-4eee-ab0b-e7e25a748f54",
      "workspaceId": "6eb233d7-b1c6-4248-9255-5a0d223f3456"
    }
  }
}

Sample response

Definitions

Name Description
ErrorRelatedResource

The error related resource details object.

ErrorResponse

The error response.

ErrorResponseDetails

The error response details.

ItemReferenceById

An item reference by ID object.

ItemReferenceByVariable

An item reference by variable.

ItemReferenceType

The item reference type. Additional ItemReferenceType types may be added over time.

LakehouseOneLakeDiagnosticSettingsDestination

Lakehouse destination for OneLake diagnostic logs.

OneLakeDiagnosticSettings

OneLake diagnostic settings object.

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 (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.

relatedResource

ErrorRelatedResource

The error related resource details.

ItemReferenceById

An item reference by ID object.

Name Type Description
itemId

string (uuid)

The ID of the item.

referenceType string:

ById

The item reference type.

workspaceId

string (uuid)

The workspace ID of the item.

ItemReferenceByVariable

An item reference by variable.

Name Type Description
referenceType string:

ByVariable

The item reference type.

variableReference

string

A variable reference string that specifies the Variable Library and the variable name inside it. Format: $(/**/_VarLibrary_/_VarName_) for a Variable Library named VarLibrary and a variable named VarName.

ItemReferenceType

The item reference type. Additional ItemReferenceType types may be added over time.

Value Description
ById

The item is referenced by its ID.

ByVariable

The item is referenced by a variable.

LakehouseOneLakeDiagnosticSettingsDestination

Lakehouse destination for OneLake diagnostic logs.

Name Type Description
lakehouse ItemReference:

Reference to the destination lakehouse.

type string:

Lakehouse

The item type of the destination.

OneLakeDiagnosticSettings

OneLake diagnostic settings object.

Name Type Description
destination OneLakeDiagnosticSettingsDestinationInfo:

LakehouseOneLakeDiagnosticSettingsDestination

The destination where OneLake diagnostic logs are stored. If disabling, this is not required.

status

string

The status of the diagnostics settings.