cancel
Showing results for 
Search instead for 
Did you mean: 
Data Engineering
Join discussions on data engineering best practices, architectures, and optimization strategies within the Databricks Community. Exchange insights and solutions with fellow data engineers.
cancel
Showing results for 
Search instead for 
Did you mean: 

Looking for reference DABs bundle yaml and resources for Databricks app deployment (FastAPI redirect

bhawana-pandey
New Contributor III

Looking for example databricks.yml and bundle resources for deploying a FastAPI Databricks app using DABs from one environment to another. Deployment works but FastAPI redirects to localhost after deployment, though the homepage loads fine. Need reference code or repo that handles FastAPI URL routing correctly in Databricks apps using DABs.Have tried official docs and community posts but stuck on redirect issues. Any pointers, working samples, or bundle configs would be appreciated.

We are exploring three different methods for deploying applications using Databricks app bundles, as defined in the resource\app_deployment.yml file:

  1. Basic App Deployment:

    resources:
    apps:
    my_app:
    name: "app-with-database"
    source_code_path: ../app
    description: "A Dash app leveraging an OLTP Database"
    # Specifies resources accessible by this app
  2. Deployment with Lakebase Database Integration:

    resources:
    apps:
    my_app:
    name: "app-with-database"
    source_code_path: ../app
    description: "A Dash app leveraging an OLTP Database"
    resources:
    - name: "app-db"
    description: "Lakebase database service"
    database:
    database_name: app-sample
    instance_name: "instance-id....<>..<>"
    permission: "CAN_CONNECT_AND_CREATE"
  3. Deployment Using a Job Manager App:

    resources:
    apps:
    job_manager:
    name: "job_manager"
    description: "An application dedicated to managing jobs created within this app bundle"
    source_code_path: ../src/app

Each method has specific configurations and purposes. We are currently seeking best practices or sample configurations for correctly deploying such apps, especially those that utilize databases or job management, within Databricks app deployment bundles. Any guidance, working examples, or resource bundles that handle these cases, particularly addressing issues like FastAPI redirecting incorrectly after deployment, would be greatly appreciated.

1 REPLY 1

AbhaySingh
Databricks Employee
Databricks Employee

This is a great place to start:

https://apps-cookbook.dev/resources/

Happy to answer specifics as they come after you've reviewed that resource.