Skip to content
Lucas Lessa
Voltar para as notícias
DatabricksGAImpacto: Médio

Workspace-level package repositories for Databricks Apps

Workspace admins can configure default Python and npm package repositories for Databricks Apps.

O que mudou

With this new feature, workspace admins can configure default Python and npm package repositories for Databricks Apps, allowing apps to inherit the configuration automatically. Developers can still override these settings at the app level if needed.

Use cases

Imagine you have multiple Databricks Apps that need to install private packages from a corporate registry without requiring every developer to manually configure URLs.

  • Centralize default Python and npm package repositories at the workspace level.
  • Install packages from internal sources without explicitly defining URLs in the code.
  • Securely store credentials and repository URLs using Databricks secrets.

How to use

You can configure the repositories using the Databricks CLI to create the secret scope and add the predefined keys.

databricks secrets create-scope databricks-package-management
databricks secrets put-acl databricks-package-management admins MANAGE
databricks secrets put-acl databricks-package-management users READ

What happens in this code:

  1. Creates a secret scope named databricks-package-management.
  2. Grants management permission to administrators.
  3. Grants read permission to all workspace users.

To add the npm configuration for Databricks Apps, use the secret put command with the corresponding key:

databricks secrets put-secret --json '{"scope": "databricks-package-management", "key": "npm-rc", "string_value":"registry=https://npm.example.com/\n//npm.example.com/:_authToken=<token>\n"}'

What happens in this code:

  1. Inserts the complete .npmrc file content into the predefined scope.
  2. Associates the npm-rc key exclusively for Databricks Apps.
  3. Enables apps in the workspace to use the configured registry during the build process.

Limitations and requirements

  • Generally available (GA) for Databricks Apps.
  • Secret changes for Databricks Apps are applied the next time the app is built and deployed.
  • Values specified directly in code or in an app's app.yaml file take precedence over workspace defaults.
Ver nota oficial do Databricks

Workspace-level package repositories for Databricks Apps are generally available

Resumo e explicação gerados por IA a partir da release note oficial. Em caso de dúvida, a documentação oficial da plataforma prevalece.

Relacionadas