Set Azure DataBricks BearerToken to Never Expire
Hello!
Found another trick with setting the expiry date to access tokens in Azure Databricks to never expire, and I don’t recall seeing it in the documentation but it is there as a tool-tip, and who ever reads those!
In Azure Databricks these Personal Access Tokens allow users to access the Rest API; however a token must first be created manually after a Workspace has been created. Note that tokens can be created and revoked via the API, however the fact is that a token must first be created manually prior to using the API. I know I’ve said it already but it’s worth repeating myself on this one. In addition to the Rest API there is a CLI, however the CLI uses the REST API itself and does not have all of the featues of the rest API. The excellent azure.databricks.cicd.tools uses the rest API to help build CI/CD pipelines.
Anyway, so how are the token set to never expire? Simply never set an expiry date for them to live forever. Handy!
it’s worth noting that in the New-DatabricksBearerToken Function in azure.databricks.cicd.tools that if you do not specify a lifetime in seconds then it will create one indefinitely. If you are using Azure Databricks I urge you to use thi module, not least because it is very good but also that the owner is open to pull requests and I’ve been contributing changes!