← All writing

Databricks Issues

Let's keep track of the different issues we come across with Databricks.

1. context deadline exceeded on 169.254.169.254

This one popped up while using Terraform to configure our Databricks workspaces with Azure managed identity authentication (azure_use_msi). The request timed out while trying to get a token.

Error:

Error: cannot read group: failed during request visitor: inner token: token request: Get "http://169.254.169.254/metadata/identity/oauth2/token?api-version=2018-02-01&client_id=0a000000-a0a0-0aa0-a0a0-0a0a0aa0aa00&resource=0aa0a0a0-0a00-0aa0-a0a0-a0a0a0a0a0a0": context deadline exceeded

What the error tells me

The managed identity authentication flow tried to reach the Azure Instance Metadata Service (IMDS) at 169.254.169.254 and timed out before it could get a token.

What fixed it

Moving Terraform to an Azure VM with the managed identity assigned fixed it. Authentication worked when I ran it there.

The VM needs the identity assigned, and that identity needs the required Databricks access. The Databricks managed identity documentation lists the configuration requirements.

For Azure DevOps agent-assigned managed identity authentication, Microsoft specifies a self-hosted agent on an Azure VM configured with that identity. A Microsoft-hosted pipeline agent isn’t interchangeable with that setup. See Azure Pipelines authentication troubleshooting.