Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-08-2024 03:42 AM
Let me clean-up these cells for better readability:
%pip install databricks-sdk --upgradedbutils.library.restartPython()from databricks.sdk import WorkspaceClient
from databricks.sdk.service import catalogw = WorkspaceClient()# This works without issue. The location is owned by me when created.
external_location_create = w.external_locations.create(
name="external_location_name",
credential_name="xxx",
comment="Source Data",
url="abfss://source-data@yyy.dfs.core.windows.net"
)# This does not work. I get the PermissionDenied error.
external_location_update = w.external_locations.update(
name="external_location_name",
owner="Zzz Metastore Administrators",
isolation_mode=catalog.IsolationMode.ISOLATION_MODE_ISOLATED
)# This does work if I remove the isolation_mode line.
external_location_update = w.external_locations.update(
name="external_location_name",
owner="Zzz Metastore Administrators"
)# This also fails with the PermissionDenied error.
external_loc_bind = w.workspace_bindings.update_bindings(
securable_type=catalog.UpdateBindingsSecurableType.EXTERNAL_LOCATION,
securable_name="external_location_name",
add=[(catalog.WorkspaceBinding(binding_type=catalog.WorkspaceBindingBindingType.BINDING_TYPE_READ_WRITE, workspace_id=1111111111111111))]
)