Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion databricks/sdk/credentials_provider.py
Original file line number Diff line number Diff line change
Expand Up @@ -1138,7 +1138,13 @@ def __call__(self, cfg: "Config") -> CredentialsProvider:
header_factory = model_serving_auth_visitor(cfg, self.credential_type)
if not header_factory:
raise ValueError(
f"Unable to authenticate using {self.credential_type} in Databricks Model Serving Environment"
"Unable to authenticate using model_serving_user_credentials in Databricks Model Serving Environment. "
"This error typically occurs when the WorkspaceClient is instantiated at model-loading time rather than within a predict() or predict_stream() call. "
"Please ensure you instantiate the WorkspaceClient inside your predict() or predict_stream() function. "
"Additionally, verify that you have specified UserAuthPolicy when logging the agent model and that "
"On Behalf of User Authorization for Agents is enabled in your workspace. "
"Refer to the documentation for more information: https://docs.databricks.com/aws/en/generative-ai/agent-framework/authenticate-on-behalf-of-user. "
"If the issue persists, contact Databricks Support."
)
return header_factory
else:
Expand Down
Loading