Audit and monitor data sharing using Delta Sharing (for providers)
This article describes how data providers can use Azure Databricks audit logs to monitor Delta Sharing events, including:
- When someone creates, modifies, updates, or deletes a share or a recipient
- When a recipient accesses an activation link and downloads the credential
- When a recipient accesses shares.
- When a recipient accesses data in shared tables.
- When a recipient’s credential is rotated or expires.
For information about how data recipients can audit Delta Sharing events to understand who is accessing which data, see Audit and monitor data access using Delta Sharing (for recipients).
Requirements
An account admin must set up audit logging for your Azure Databricks account. See Enable audit logging and Configure diagnostic log delivery.
View Delta Sharing events in the audit log
To view audit logs for your account, you need to know where the logs are delivered. For information about how logs are delivered, see Configure diagnostic log delivery.
Events for Delta Sharing are logged with serviceName set to unityCatalog. Actions that are performed by recipients start with the deltaSharing prefix.
Logged event examples
The following audit event logs an update to the recipient token lifetime. In this example, redacted values are replaced with <redacted>.
{
"version":"2.0",
"auditLevel":"ACCOUNT_LEVEL",
"timestamp":1629775584891,
"orgId":"3049059095686970",
"shardName":"example-workspace",
"accountId":"<redacted>",
"sourceIPAddress":"<redacted>",
"userAgent":"curl/7.64.1",
"sessionId":"<redacted>",
"userIdentity":{
"email":"<redacted>",
"subjectName":null
},
"serviceName":"unityCatalog",
"actionName":"updateMetastore",
"requestId":"<redacted>",
"requestParams":{
"metastore_id":"<redacted>",
"delta_sharing_scope":"INTERNAL_AND_EXTERNAL"
"delta_sharing_recipient_token_lifetime_in_seconds": 31536000
},
"response":{
"statusCode":200,
"errorMessage":null,
"result":null
},
"MAX_LOG_MESSAGE_LENGTH":16384
}
The following audit event logs a recipient’s action to query a table that you, as the provider, have shared with them.
{
"Version": "2.0",
"auditLevel": "ACCOUNT_LEVEL",
"Timestamp": 1635235341950,
"orgId": "0",
"shardName": "example-workspace",
"accountId": "<redacted>",
"sourceIPAddress": "<redacted>",
"userAgent": null,
"sessionId": null,
"userIdentity": null,
"serviceName": "unityCatalog",
"actionName": "deltaSharingQueriedTable",
"requestId": "<redacted>",
"requestParams": {
"Metastore_id": "<redacted>",
"Options": "{}",
"Recipient_name": "ip_recipient"
},
"Response": {
"statusCode": 200,
"errorMessage": null,
"Result": {
"checkpointBytes": "0",
"maxRemoveFiles": "0",
"path": "file: example/s3/path/golden/snapshot-data0/_delta_log",
"scannedAddFileSize": "1300",
"jsonLogFileNum": "1",
"scannedJsonLogActionNum": "5",
"jsonLogFileBytes": "914",
"checkpointFileNum": "0",
"metastoreId": "<redacted>",
"limitHint": "Some(1)",
"tableName": "tableName",
"tableId": "1",
"activeAddFiles": "2",
"scannedCheckpointActionNum": "0",
"deltaSharingRecipientIdHash": "recipient_hash_id",
"tableVersion": "0"
}
},
"MAX_LOG_MESSAGE_LENGTH": 16384
}
Logged event details
The following table lists audited Delta Sharing actions that are delivered to data provider logs. Recipient-initiated events are marked “Recipient action.” Provider-initiated events are marked “Provider action.”
| actionName | requestParams |
|---|---|
deltaSharingListSharesRecpient action |
options: The pagination options provided with this request.recipient_name: Indicates the recipient executing the action.is_ip_access_denied: None if there is no IP access list configured. Otherwise, true if the request was denied andfalse if the request was not denied. sourceIPaddress is the recipient IP address. |
deltaSharingGetShareRecpient action |
share: The name of the share.recipient_name: Indicates the recipient executing the action.is_ip_access_denied: None if there is no IP access list configured. Otherwise, true if the request was denied andfalse if the request was not denied. sourceIPaddress is the recipient IP address. |
deltaSharingListSchemasRecpient action |
share: The name of the share.recipient_name: Indicates the recipient executing the action.options: The pagination options provided with this request.is_ip_access_denied: None if there is no IP access list configured. Otherwise, true if the request was denied andfalse if the request was not denied. sourceIPaddress is the recipient IP address. |
deltaSharingListAllTablesRecpient action |
share: The name of the share.recipient_name: Indicates the recipient executing the action.is_ip_access_denied: None if there is no IP access list configured. Otherwise, true if the request was denied andfalse if the request was not denied. sourceIPaddress is the recipient IP address. |
deltaSharingListTablesRecpient action |
share: The name of the share.recipient_name: Indicates the recipient executing the action.options: The pagination options provided with this request.is_ip_access_denied: None if there is no IP access list configured. Otherwise, true if the request was denied andfalse if the request was not denied. sourceIPaddress is the recipient IP address. |
deltaSharingGetTableMetadataRecpient action |
share: The name of the share.recipient_name: Indicates the recipient executing the action.schema: The name of the schema.name: The name of the table.predicateHints: The predicates included in the query.limitHints: The maximum number of rows to return.is_ip_access_denied: None if there is no IP access list configured. Otherwise, true if the request was denied andfalse if the request was not denied. sourceIPaddress is the recipient IP address. |
deltaSharingGetTableVersionRecpient action |
share: The name of the share.recipient_name: Indicates the recipient executing the action.schema: The name of the schema.name: The name of the table.is_ip_access_denied: None if there is no IP access list configured. Otherwise, true if the request was denied andfalse if the request was not denied. sourceIPaddress is the recipient IP address. |
deltaSharingQueryTableRecpient action |
share: The name of the share.recipient_name: Indicates the recipient executing the action.schema: The name of the schema.name: The name of the table.predicateHints: The predicates included in the query.limitHint: The maximum number of rows to return.is_ip_access_denied: None if there is no IP access list configured. Otherwise, true if the request was denied andfalse if the request was not denied. sourceIPaddress is the recipient IP address. |
deltaSharingQueryTableChangesRecpient action |
share: The name of the share.recipient_name: Indicates the recipient executing the action.schema: The name of the schema.name: The name of the table.cdf_options: Change data feed options.is_ip_access_denied: None if there is no IP access list configured. Otherwise, true if the request was denied andfalse if the request was not denied. sourceIPaddress is the recipient IP address. |
deltaSharingQueriedTableRecpient action |
recipient_name: Indicates the recipient executing the action.is_ip_access_denied: None if there is no IP access list configured. Otherwise, true if the request was denied andfalse if the request was not denied. sourceIPaddress is the recipient IP address. |
deltaSharingQueriedTableChangesRecpient action |
recipient_name: Indicates the recipient executing the action.is_ip_access_denied: None if there is no IP access list configured. Otherwise, true if the request was denied andfalse if the request was not denied. sourceIPaddress is the recipient IP address. |
updateMetastoreProvider action |
delta_sharing_scope: values can be “INTERNAL” or “INTERNAL_AND_EXTERNAL”delta_sharing_recipient_token_lifetime_in_seconds: If present, indicates that the recipient token lifetime was updated. |
createRecipientProvider action |
name: The name of the recipient.comment: The comment for the recipient.ip_access_list.allowed_ip_addresses: Recipient IP address allowlist. |
deleteRecipientProvider action |
name: The name of the recipient. |
getRecipientProvider action |
name: The name of the recipient. |
listRecipientsProvider action |
none |
rotateRecipientTokenProvider action |
name: The name of the recipient.comment: The comment given in the rotation command. |
updateRecipientProvider action |
name: The name of the recipient.updates: A JSON representation of recipient attributes that were added or removed from the share. Each item includes action (add or remove) and can include name (the new recipient name), owner (new owner),comment, and ip_access_list.allowed_ip_addresses (recipient IP address allowlist). |
createShareProvider action |
name: The name of the share.comment: The comment for the share. |
deleteShareProvider action |
name: The name of the share. |
getShareProvider action |
name: The name of the share.include_shared_objects: Whether the share’s table names were included in the request. |
updateShareProvider action |
name: The name of the share.updates: A JSON representation of tables that were added or removed from the share. Each item includes action (add or remove), name (the actual name of the table), shared_as (the name the schema and table were shared as, if different from name), and partition_specification (if a partition specification was provided). |
listSharesProvider action |
none |
getSharePermissionsProvider action |
name: The name of the share. |
updateSharePermissionsProvider action |
name: The name of the share.changes: A JSON representation of the updated permissions. Each change includes principal (the user or group to whom permission is granted or revoked), add (the list of permissions that were granted), remove (the list of permissions that were revoked). |
getRecipientSharePermissionsProvider action |
name: The name of the share. |
getActivationUrlInfoProvider action |
recipient_name: The name of the recipient who opened the activation URL.is_ip_access_denied: None if there is no IP access list configured. Otherwise, true if the request was denied andfalse if the request was not denied. sourceIPaddress is the recipient IP address. |
retrieveRecipientTokenProvider action |
recipient_name: The name of the recipient who downloaded the token.is_ip_access_denied: None if there is no IP access list configured. Otherwise, true if the request was denied andfalse if the request was not denied. sourceIPaddress is the recipient IP address. |
In addition to the actions and parameters included in the table, the following are also logged:
- Catalog, schema, and table access events. See Unity Catalog events.
- Request parameters that are always present in the audit log for each action:
userIdentity.email: The ID of the user who initiated the activity.requestParams.metastore_id: the Unity Catalog metastore that manages the shared data.
Response fields for recipient-initiated events
Responses can include the following key-value pairs under Result:. Values here are examples only. This list is not exhaustive.
"checkpointBytes": "0",
"earlyTermination": "false",
"maxRemoveFiles": "0",
"path": "file: example/s3/path/golden/snapshot-data0/_delta_log",
"deltaSharingPartitionFilteringAccessed": "false",
"deltaSharingRecipientId": "<redacted>",
"deltaSharingRecipientIdHash": "<recipient-hash-id>",
"jsonLogFileNum": "1",
"scannedJsonLogActionNum": "5",
"numRecords": "3",
"deltaSharingRecipientMetastoreId": "<redacted>",
"userAgent": "Delta-Sharing-Unity-Catalog-Databricks-Auth/1.0 Linux/4.15.0-2068-azure-fips OpenJDK_64-Bit_Server_VM/11.0.7+10-jvmci-20.1-b02 java/11.0.7 scala/2.12.15 java_vendor/GraalVM_Community",
"jsonLogFileBytes": "2846",
"checkpointFileNum": "0",
"metastoreId": "<redacted>",
"limitHint": "Some(1)",
"tableName": "cookie_ingredients",
"tableId": "1234567c-6d8b-45fd-9565-32e9fc23f8f3",
"activeAddFiles": "2", // number of AddFiles returned in the query
"numAddFiles": "2", // number of AddFiles returned in the query
"numAddCDCFiles": "2", // number of AddFiles returned in the CDF query
"numRemoveFiles": "2", // number of RemoveFiles returned in the query
"numSeenAddFiles": "3",
"scannedAddFileSize": "1300", // file size in bytes for the AddFile returned in the query
"scannedAddCDCFileSize": "1300", // file size in bytes for the AddCDCFile returned in the CDF query
"scannedRemoveFileSize": "1300", // file size in bytes for the RemoveFile returned in the query
"scannedCheckpointActionNum": "0",
"tableVersion": "0"
Logged errors
Delta Sharing logs the following errors for data providers. Items between < and > characters represent placeholder text.
Delta Sharing is not enabled on the selected metastore.
DatabricksServiceException: FEATURE_DISABLED: Delta Sharing is not enabledAn operation was attempted on a catalog that does not exist.
DatabricksServiceException: CATALOG_DOES_NOT_EXIST: Catalog ‘<catalog>’ does not exist.A user who is not an account admin or metastore admin attempted to perform a privileged operation.
DatabricksServiceException: PERMISSION_DENIED: Only administrators can <operation-name> <operation-target>An operation was attempted on a metastore from a workspace to which the metastore is not assigned.
DatabricksServiceException: INVALID_STATE: Workspace <workspace-name> is no longer assigned to this metastoreA request was missing the recipient name or share name.
DatabricksServiceException: INVALID_PARAMETER_VALUE: CreateRecipient/CreateShare Missing required field: <recipient-name>/<share-name>A request included an invalid recipient name or share name.
DatabricksServiceException: INVALID_PARAMETER_VALUE: CreateRecipient/CreateShare <recipient-name>/<share-name> is not a valid nameA user attempted to share a table that is not in a Unity Catalog metastore.
DatabricksServiceException: INVALID_PARAMETER_VALUE: Only managed or external table on Unity Catalog can be added to a shareA user attempted to rotate a recipient that was already in a rotated state and whose previous token had not yet expired.
DatabricksServiceException: INVALID_PARAMETER_VALUE: There are already two active tokens for recipient <recipient-name>A user attempted to create a new recipient or share with the same name as an existing one.
DatabricksServiceException: RECIPIENT_ALREADY_EXISTS/SHARE_ALREADY_EXISTS: Recipient/Share <name> already exists`A user attempted to perform an operation on a recipient or share that does not exist.
DatabricksServiceException: RECIPIENT_DOES_NOT_EXIST/SHARE_DOES_NOT_EXIST: Recipient/Share '<name>' does not existA user attempted to add a table to a share, but the table had already been added.
DatabricksServiceException: RESOURCE_ALREADY_EXISTS: Shared Table '<name>' already existsA user attempted to perform an operation that referenced a table that does not exist.
DatabricksServiceException: TABLE_DOES_NOT_EXIST: Table '<name>' does not existA user attempted to perform an operation that referenced a schema that did not exist.
DatabricksServiceException: SCHEMA_DOES_NOT_EXIST: Schema '<name>' does not exist
For a list of auditable events and errors logged for data recipients, see Audit and monitor data access using Delta Sharing (for recipients).
Feedback
Submit and view feedback for