Credentials never belong in notebook code. An Azure Key Vault-backed secret scope lets a notebook read a Key Vault secret with dbutils.secrets.get(scope, key). You manage the secret values in Key Vault, and Azure Databricks redacts a secret value that appears in notebook output.
A service principal is an identity for automation rather than a person. Run production jobs as a service principal, so they keep working when an employee leaves and hold only the grants the pipeline needs. Tools such as a CI pipeline authenticate as a service principal with OAuth credentials from their own secret store.
A managed identity removes the stored secret altogether. An Access Connector for Azure Databricks holds a managed identity. Grant it a storage role on the Azure Data Lake Storage account, then create a Unity Catalog storage credential and an external location that use the connector. These exercises are design decisions, because the practice workspace has no Azure tenant behind it.
dbutils.secrets.get reads the secret through the scope at run time, so the value never appears in the code.