Skip to main content

vw_app_resources

Creates, updates, deletes, gets or lists a vw_app_resources resource.

Overview

Namevw_app_resources
TypeView
Iddatabricks_workspace.apps.vw_app_resources

Fields

The following fields are returned by this view:

NameDatatypeDescription
deployment_namestringWorkspace deployment name used to scope the query.
app_namestringName of the app that owns this resource binding.
app_idstringID of the app that owns this resource binding.
resource_namestringName used to reference this resource within the app (one row per resource).
resource_descriptionstringOptional description of the resource binding.
resource_typestringDerived resource type - one of JOB, SQL_WAREHOUSE, SERVING_ENDPOINT, SECRET, EXPERIMENT, DATABASE, GENIE_SPACE, UC_SECURABLE, or UNKNOWN.
job_idstringID of the bound Databricks job (JOB type only).
job_permissionstringPermission level granted to the app on the job (JOB type only).
sql_warehouse_idstringID of the bound SQL warehouse (SQL_WAREHOUSE type only).
sql_warehouse_permissionstringPermission level granted to the app on the SQL warehouse (SQL_WAREHOUSE type only).
serving_endpoint_namestringName of the bound model serving endpoint (SERVING_ENDPOINT type only).
serving_endpoint_permissionstringPermission level granted to the app on the serving endpoint (SERVING_ENDPOINT type only).
secret_scopestringSecret scope containing the bound secret (SECRET type only).
secret_keystringKey of the bound secret within the scope (SECRET type only).
secret_permissionstringPermission level granted to the app on the secret (SECRET type only).
experiment_idstringID of the bound MLflow experiment (EXPERIMENT type only).
experiment_permissionstringPermission level granted to the app on the experiment (EXPERIMENT type only).
database_instancestringInstance name of the bound Databricks database (DATABASE type only).
database_namestringName of the bound database (DATABASE type only).
database_permissionstringPermission level granted to the app on the database (DATABASE type only).
genie_space_idstringID of the bound Genie space (GENIE_SPACE type only).
genie_space_permissionstringPermission level granted to the app on the Genie space (GENIE_SPACE type only).
uc_securable_namestringFull name of the bound Unity Catalog securable (UC_SECURABLE type only).
uc_securable_typestringType of the Unity Catalog securable (e.g. TABLE, SCHEMA, CATALOG) (UC_SECURABLE type only).
uc_securable_permissionstringPermission level granted to the app on the Unity Catalog securable (UC_SECURABLE type only).

Required Parameters

The following parameters are required by this view:

NameDatatypeDescription
deployment_namestringWorkspace deployment name used to scope the query.

SELECT Examples

SELECT
deployment_name,
app_name,
app_id,
resource_name,
resource_description,
resource_type,
job_id,
job_permission,
sql_warehouse_id,
sql_warehouse_permission,
serving_endpoint_name,
serving_endpoint_permission,
secret_scope,
secret_key,
secret_permission,
experiment_id,
experiment_permission,
database_instance,
database_name,
database_permission,
genie_space_id,
genie_space_permission,
uc_securable_name,
uc_securable_type,
uc_securable_permission
FROM databricks_workspace.apps.vw_app_resources
WHERE deployment_name = '{{ deployment_name }}';

SQL Definition

SELECT
a.deployment_name,
a.name AS app_name,
a.id AS app_id,
JSON_EXTRACT(r.value, '$.name') AS resource_name,
JSON_EXTRACT(r.value, '$.description') AS resource_description,
CASE
WHEN JSON_EXTRACT(r.value, '$.job') IS NOT NULL THEN 'JOB'
WHEN JSON_EXTRACT(r.value, '$.sql_warehouse') IS NOT NULL THEN 'SQL_WAREHOUSE'
WHEN JSON_EXTRACT(r.value, '$.serving_endpoint') IS NOT NULL THEN 'SERVING_ENDPOINT'
WHEN JSON_EXTRACT(r.value, '$.secret') IS NOT NULL THEN 'SECRET'
WHEN JSON_EXTRACT(r.value, '$.experiment') IS NOT NULL THEN 'EXPERIMENT'
WHEN JSON_EXTRACT(r.value, '$.database') IS NOT NULL THEN 'DATABASE'
WHEN JSON_EXTRACT(r.value, '$.genie_space') IS NOT NULL THEN 'GENIE_SPACE'
WHEN JSON_EXTRACT(r.value, '$.uc_securable') IS NOT NULL THEN 'UC_SECURABLE'
ELSE 'UNKNOWN'
END AS resource_type,
JSON_EXTRACT(r.value, '$.job.id') AS job_id,
JSON_EXTRACT(r.value, '$.job.permission') AS job_permission,
JSON_EXTRACT(r.value, '$.sql_warehouse.id') AS sql_warehouse_id,
JSON_EXTRACT(r.value, '$.sql_warehouse.permission') AS sql_warehouse_permission,
JSON_EXTRACT(r.value, '$.serving_endpoint.name') AS serving_endpoint_name,
JSON_EXTRACT(r.value, '$.serving_endpoint.permission') AS serving_endpoint_permission,
JSON_EXTRACT(r.value, '$.secret.scope') AS secret_scope,
JSON_EXTRACT(r.value, '$.secret.key') AS secret_key,
JSON_EXTRACT(r.value, '$.secret.permission') AS secret_permission,
JSON_EXTRACT(r.value, '$.experiment.experiment_id') AS experiment_id,
JSON_EXTRACT(r.value, '$.experiment.permission') AS experiment_permission,
JSON_EXTRACT(r.value, '$.database.instance_name') AS database_instance,
JSON_EXTRACT(r.value, '$.database.database_name') AS database_name,
JSON_EXTRACT(r.value, '$.database.permission') AS database_permission,
JSON_EXTRACT(r.value, '$.genie_space.space_id') AS genie_space_id,
JSON_EXTRACT(r.value, '$.genie_space.permission') AS genie_space_permission,
JSON_EXTRACT(r.value, '$.uc_securable.securable_full_name') AS uc_securable_name,
JSON_EXTRACT(r.value, '$.uc_securable.securable_type') AS uc_securable_type,
JSON_EXTRACT(r.value, '$.uc_securable.permission') AS uc_securable_permission
FROM databricks_workspace.apps.apps a,
JSON_EACH(a.resources) r
WHERE deployment_name = '{{ deployment_name }}'