Skip to main content

app_deployments

Creates, updates, deletes, gets or lists an app_deployments resource.

Overview

Nameapp_deployments
TypeResource
Iddatabricks_workspace.apps.app_deployments

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
deployment_idstringThe unique id of the deployment.
commandarray
create_timestringThe creation time of the deployment. Formatted timestamp in ISO 6801.
creatorstringThe email of the user creates the deployment.
deployment_artifactsobjectThe deployment artifacts for an app.
env_varsarrayThe environment variables to set in the app runtime environment. This will override the environment variables specified in the app.yaml file.
git_sourceobjectGit repository to use as the source for the app deployment.
modestringThe mode of which the deployment will manage the source code. (AUTO_SYNC, SNAPSHOT)
source_code_pathstringThe workspace file system path of the source code used to create the app deployment. This is different from `deployment_artifacts.source_code_path`, which is the path used by the deployed app. The former refers to the original source code location of the app in the workspace during deployment creation, whereas the latter provides a system generated stable snapshotted source code path used by the deployment.
statusobjectStatus and status message of the deployment
update_timestringThe update time of the deployment. Formatted timestamp in ISO 6801.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectapp_name, deployment_id, deployment_nameRetrieves information for the app deployment with the supplied name and deployment id.
listselectapp_name, deployment_namepage_size, page_tokenLists all app deployments for the app with the supplied name.
createinsertapp_name, deployment_name, app_deploymentCreates an app deployment for the app with the supplied name.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
app_namestringThe name of the app.
deployment_idstringThe unique id of the deployment.
deployment_namestringThe Databricks Workspace Deployment Name (default: dbc-abcd0123-a1bc)
page_sizeintegerUpper bound for items returned.
page_tokenstringPagination token to go to the next page of apps. Requests first page if absent.

SELECT examples

Retrieves information for the app deployment with the supplied name and deployment id.

SELECT
deployment_id,
command,
create_time,
creator,
deployment_artifacts,
env_vars,
git_source,
mode,
source_code_path,
status,
update_time
FROM databricks_workspace.apps.app_deployments
WHERE app_name = '{{ app_name }}' -- required
AND deployment_id = '{{ deployment_id }}' -- required
AND deployment_name = '{{ deployment_name }}' -- required
;

INSERT examples

Creates an app deployment for the app with the supplied name.

INSERT INTO databricks_workspace.apps.app_deployments (
app_deployment,
app_name,
deployment_name
)
SELECT
'{{ app_deployment }}' /* required */,
'{{ app_name }}',
'{{ deployment_name }}'
RETURNING
deployment_id,
command,
create_time,
creator,
deployment_artifacts,
env_vars,
git_source,
mode,
source_code_path,
status,
update_time
;