vw_app_resources
Creates, updates, deletes, gets or lists a vw_app_resources resource.
Overview
| Name | vw_app_resources |
| Type | View |
| Id | databricks_workspace.apps.vw_app_resources |
Fields
The following fields are returned by this view:
| Name | Datatype | Description |
|---|---|---|
deployment_name | string | Workspace deployment name used to scope the query. |
app_name | string | Name of the app that owns this resource binding. |
app_id | string | ID of the app that owns this resource binding. |
resource_name | string | Name used to reference this resource within the app (one row per resource). |
resource_description | string | Optional description of the resource binding. |
resource_type | string | Derived resource type - one of JOB, SQL_WAREHOUSE, SERVING_ENDPOINT, SECRET, EXPERIMENT, DATABASE, GENIE_SPACE, UC_SECURABLE, or UNKNOWN. |
job_id | string | ID of the bound Databricks job (JOB type only). |
job_permission | string | Permission level granted to the app on the job (JOB type only). |
sql_warehouse_id | string | ID of the bound SQL warehouse (SQL_WAREHOUSE type only). |
sql_warehouse_permission | string | Permission level granted to the app on the SQL warehouse (SQL_WAREHOUSE type only). |
serving_endpoint_name | string | Name of the bound model serving endpoint (SERVING_ENDPOINT type only). |
serving_endpoint_permission | string | Permission level granted to the app on the serving endpoint (SERVING_ENDPOINT type only). |
secret_scope | string | Secret scope containing the bound secret (SECRET type only). |
secret_key | string | Key of the bound secret within the scope (SECRET type only). |
secret_permission | string | Permission level granted to the app on the secret (SECRET type only). |
experiment_id | string | ID of the bound MLflow experiment (EXPERIMENT type only). |
experiment_permission | string | Permission level granted to the app on the experiment (EXPERIMENT type only). |
database_instance | string | Instance name of the bound Databricks database (DATABASE type only). |
database_name | string | Name of the bound database (DATABASE type only). |
database_permission | string | Permission level granted to the app on the database (DATABASE type only). |
genie_space_id | string | ID of the bound Genie space (GENIE_SPACE type only). |
genie_space_permission | string | Permission level granted to the app on the Genie space (GENIE_SPACE type only). |
uc_securable_name | string | Full name of the bound Unity Catalog securable (UC_SECURABLE type only). |
uc_securable_type | string | Type of the Unity Catalog securable (e.g. TABLE, SCHEMA, CATALOG) (UC_SECURABLE type only). |
uc_securable_permission | string | Permission level granted to the app on the Unity Catalog securable (UC_SECURABLE type only). |
Required Parameters
The following parameters are required by this view:
| Name | Datatype | Description |
|---|---|---|
deployment_name | string | Workspace 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
- Sqlite3
- Postgres
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 }}'
SELECT
a.deployment_name,
a.name AS app_name,
a.id AS app_id,
r.value->>'name' AS resource_name,
r.value->>'description' AS resource_description,
CASE
WHEN r.value->'job' IS NOT NULL THEN 'JOB'
WHEN r.value->'sql_warehouse' IS NOT NULL THEN 'SQL_WAREHOUSE'
WHEN r.value->'serving_endpoint' IS NOT NULL THEN 'SERVING_ENDPOINT'
WHEN r.value->'secret' IS NOT NULL THEN 'SECRET'
WHEN r.value->'experiment' IS NOT NULL THEN 'EXPERIMENT'
WHEN r.value->'database' IS NOT NULL THEN 'DATABASE'
WHEN r.value->'genie_space' IS NOT NULL THEN 'GENIE_SPACE'
WHEN r.value->'uc_securable' IS NOT NULL THEN 'UC_SECURABLE'
ELSE 'UNKNOWN'
END AS resource_type,
r.value->'job'->>'id' AS job_id,
r.value->'job'->>'permission' AS job_permission,
r.value->'sql_warehouse'->>'id' AS sql_warehouse_id,
r.value->'sql_warehouse'->>'permission' AS sql_warehouse_permission,
r.value->'serving_endpoint'->>'name' AS serving_endpoint_name,
r.value->'serving_endpoint'->>'permission' AS serving_endpoint_permission,
r.value->'secret'->>'scope' AS secret_scope,
r.value->'secret'->>'key' AS secret_key,
r.value->'secret'->>'permission' AS secret_permission,
r.value->'experiment'->>'experiment_id' AS experiment_id,
r.value->'experiment'->>'permission' AS experiment_permission,
r.value->'database'->>'instance_name' AS database_instance,
r.value->'database'->>'database_name' AS database_name,
r.value->'database'->>'permission' AS database_permission,
r.value->'genie_space'->>'space_id' AS genie_space_id,
r.value->'genie_space'->>'permission' AS genie_space_permission,
r.value->'uc_securable'->>'securable_full_name' AS uc_securable_name,
r.value->'uc_securable'->>'securable_type' AS uc_securable_type,
r.value->'uc_securable'->>'permission' AS uc_securable_permission
FROM databricks_workspace.apps.apps a,
jsonb_array_elements(a.resources::jsonb) AS r
WHERE deployment_name = '{{ deployment_name }}'