Skip to main content

Deployment

View as Markdown

AppDeployment object​

A deployment of an app's source code, taken from a workspace path or a Git reference. When a deployment succeeds, it becomes the app's active deployment. See https://docs.databricks.com/aws/en/dev-tools/databricks-apps/deploy.

deployment_idstring

The unique ID of the deployment. Databricks generates the ID when the deployment is created.

Example: 01ef0bda89f21f08a8351f41e4a9b948

source_code_pathstring

The 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. Set either source_code_path or git_source, not both. If neither is set, the deployment reuses the source of the app's active deployment.

Example: /Workspace/user@test.com/my_custom_app

git_sourceobject

Git repository to use as the source for the app deployment. The repository itself is configured on the app, so set only the branch, tag or commit here, and optionally source_code_path.

Show child attributesHide child attributes
git_repositoryobjectOutput only

Git repository configuration. Populated from the app's git_repository configuration.

Show child attributesHide child attributes
urlstring<= 300 characters

URL of the Git repository.

Example: https://github.com/databricks/git_app_repo.git

providerstring

Git provider. Case insensitive. Supported values: gitHub, gitHubEnterprise, bitbucketCloud, bitbucketServer, azureDevOpsServices, gitLab, gitLabEnterpriseEdition, awsCodeCommit.

Example: gitHub

auto_deployboolean

When true, automatically deploys the app on push events to the branch configured in the app's deployment_source.git_source.

caller_credential_idint64Input only

ID of a personal access token Git credential owned by the caller, used to grant the app's service principal access to this repository.

Example: 93488329053511

branchstring<= 255 characters

Git branch to checkout.

Example: main

tagstring<= 255 characters

Git tag to checkout.

Example: v1.0.0

commitstring<= 64 characters

Git commit SHA to checkout.

Example: abc123def456

source_code_pathstring<= 500 characters

Relative path to the app source code within the Git repository. If not specified, the root of the repository is used.

Example: my-app

resolved_commitstring<= 64 charactersOutput only

The resolved commit SHA that was actually used for the deployment. This is populated by the system after resolving the reference (branch, tag, or commit). If commit is specified directly, this will match commit. If a branch or tag is specified, this contains the commit SHA that the branch or tag pointed to at deployment time.

Example: abc123def456789012345678901234567890abcd

modestring

The mode in which the deployment manages the source code. The mode defaults to SNAPSHOT, which is the only supported mode.

Values:

  • SNAPSHOT
  • AUTO_SYNC
deployment_artifactsobjectOutput only

The deployment artifacts for an app.

Show child attributesHide child attributes
source_code_pathstring

The snapshotted workspace file system path of the source code loaded by the deployed app.

Example: /Workspace/Users/9627a015-e892-43f7-9085-eec3892da408/src/01ef1a1ed75d1964b62234a35efa61fc

statusobjectOutput only

The current state of the deployment and a message that describes its progress or failure.

Show child attributesHide child attributes
statestringOutput only

State of the deployment. A deployment starts in IN_PROGRESS and ends in SUCCEEDED, FAILED or CANCELLED.

Values:

  • SUCCEEDED
  • FAILED
  • IN_PROGRESS
  • CANCELLED
messagestringOutput only

Message corresponding with the deployment state.

Example: Deployment is in progress.

create_timestringOutput only

The creation time of the deployment. Formatted timestamp in ISO 8601.

creatorstringOutput only

The email of the user that created the deployment.

Example: user@test.com

update_timestringOutput only

The update time of the deployment. Formatted timestamp in ISO 8601.

commandarray of string

The command with which to run the app. This will override the command specified in the app.yaml file.

Example: python app.py

env_varsarray of object

The environment variables to set in the app runtime environment. This will override the environment variables specified in the app.yaml file. Responses return only the variable names, not their values.

Show child attributesHide child attributes
namestring

The name of the environment variable.

Example: VOLUME_URI

valuestring

The value for the environment variable.

Example: /Volumes/catalog-name/schema-name/dir-name

value_fromstring

The name of an external <Databricks> resource that contains the value, such as a secret or a database table.

Example: volume

scan_statusstringBetaOutput only

The security scan outcome for this deployment. UNSPECIFIED means no scan result has been recorded: the scan may still be in flight, or it ended without recording one, so don't wait indefinitely for it to change. The other values are terminal.

Values:

  • APP_DEPLOYMENT_SCAN_STATUS_CLEAN
  • APP_DEPLOYMENT_SCAN_STATUS_FINDINGS
  • APP_DEPLOYMENT_SCAN_STATUS_PARTIAL
  • APP_DEPLOYMENT_SCAN_STATUS_UNAVAILABLE
  • APP_DEPLOYMENT_SCAN_STATUS_NOT_SCANNED
scan_omitted_findings_countint32BetaOutput only

The number of findings the scan reported but did not store, because the deployment hit the per-deployment findings cap. Non-zero means the listed findings are incomplete.

scan_omitted_count_is_lower_boundbooleanBetaOutput only

Whether scan_omitted_findings_count is a lower bound rather than an exact count, because the scanner itself stopped counting.

Get an app deployment GA​

GET /api/2.0/apps/{app_name}/deployments/{deployment_id}

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

API scopes: apps

Parameters​

app_namestringRequiredpath

The name of the app.

deployment_idstringRequiredpath

The unique id of the deployment.

Response​

Returns the AppDeployment object.

List app deployments GA​

GET /api/2.0/apps/{app_name}/deployments

Lists all app deployments for the app with the supplied name. The history holds only the app's most recent deployments.

API scopes: apps

Parameters​

app_namestringRequiredpath

The name of the app.

page_tokenstringquery

Pagination token to go to the next page of deployments. Requests first page if absent.

page_sizeint32query

Upper bound for items returned. The default is 100 and the maximum is 1000.

Response​

Returns a list of AppDeployment objects.

Create an app deployment GA​

POST /api/2.0/apps/{app_name}/deployments

Creates an app deployment for the app with the supplied name. The call returns while the deployment is still IN_PROGRESS; poll the deployment until it reaches a terminal state. The request fails with RESOURCE_CONFLICT if another deployment of the same app is still pending and has not timed out.

API scopes: apps

Parameters​

app_namestringRequiredpath

The name of the app.

Request body​

The app deployment configuration.

deployment_idstring

The unique ID of the deployment. Databricks generates the ID when the deployment is created.

Example: 01ef0bda89f21f08a8351f41e4a9b948

source_code_pathstring

The 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. Set either source_code_path or git_source, not both. If neither is set, the deployment reuses the source of the app's active deployment.

Example: /Workspace/user@test.com/my_custom_app

git_sourceobject

Git repository to use as the source for the app deployment. The repository itself is configured on the app, so set only the branch, tag or commit here, and optionally source_code_path.

Show child attributesHide child attributes
branchstring<= 255 characters

Git branch to checkout.

Example: main

tagstring<= 255 characters

Git tag to checkout.

Example: v1.0.0

commitstring<= 64 characters

Git commit SHA to checkout.

Example: abc123def456

source_code_pathstring<= 500 characters

Relative path to the app source code within the Git repository. If not specified, the root of the repository is used.

Example: my-app

modestring

The mode in which the deployment manages the source code. The mode defaults to SNAPSHOT, which is the only supported mode.

Values:

  • SNAPSHOT
  • AUTO_SYNC
commandarray of string

The command with which to run the app. This will override the command specified in the app.yaml file.

Example: python app.py

env_varsarray of object

The environment variables to set in the app runtime environment. This will override the environment variables specified in the app.yaml file. Responses return only the variable names, not their values.

Show child attributesHide child attributes
namestring

The name of the environment variable.

Example: VOLUME_URI

valuestring

The value for the environment variable.

Example: /Volumes/catalog-name/schema-name/dir-name

value_fromstring

The name of an external <Databricks> resource that contains the value, such as a secret or a database table.

Example: volume

Response​

Returns the AppDeployment object.