A data engineer is preparing a notebook that must authenticate to cloud storage using a short-lived token that is automatically rotated by Databricks and is never written into the notebook source. The engineer wants the least administrative overhead while keeping secrets out of the code. Which approach should the engineer use?
Attaching a cloud identity (instance profile on AWS, managed identity on Azure) to the cluster lets the notebook obtain short-lived credentials from the cloud metadata service. Databricks rotates them automatically, no secret appears in code, and access is scoped by the identity's IAM or RBAC policy. This is the lowest-overhead pattern for storage access from notebooks.
Why this answer
Attaching a cloud identity such as an instance profile or managed identity to the cluster is the standard Databricks pattern for credential-free storage access. The cluster's metadata service issues short-lived, automatically rotated credentials scoped to that identity, so nothing sensitive is stored in the notebook or job definition. Secret scopes and widgets still require manual credential handling and rotation, and workspace tokens do not authorize cloud storage access at all.
Exam trap
The trap here is assuming that a Databricks secret scope automatically rotates the underlying cloud credential, when in fact scopes only store and redact whatever value the engineer manually maintains.