balajij8
Esteemed Contributor

What you are seeing is expected behavior when the local execution environment is out of sync with the latest target schema definitions. prevent_destroy: true is a fully supported property for Unity Catalog Volume resources within Databricks Asset Bundles (DABs).  The ValueError: Unexpected field 'lifecycle' for class Volume error is a strict validation failure thrown by an older Databricks CLI bundle engine that does not yet recognize the lifecycle class for Volume resource types.

You can follow below

  • If you are running Databricks CLI version older than v1.6.0 - The local environment you use lacks the updated Python-based schema definitions that introduced volume lifecycle management. You must upgrade your Databricks CLI to v1.6.0 or higher. You can verify your current version by executing databricks --version in the terminal.

  • If your CLI is already up to date (v1.6.0+) but validation still fails - It can be due to corrupted local state cache or a YAML syntax misalignment. Delete the hidden .databricks caching directory in the project root to clear the state, ensure strict YAML indentation under the raw_zone block, and execute databricks bundle validate to force a clean parse.

  • If you are experiencing this error within an automated CI/CD pipeline - The pipeline runner (GitHub Actions, Azure DevOps, GitLab) is pulling a stale, cached version of the Databricks CLI. Ensure the pipeline configuration explicitly specifies the latest CLI version tag in its setup step.