Hello Isaac Huang,
Welcome to the Microsoft Q&A and thank you for posting your questions here.
I understand that you are unable to access Databricks Serverless Compute from the CLI and VS Code despite meeting all the requirements and following the documentation.
To clarify and simplify the previous answers given above and to follow the best practices and precise solution, kindly follow the below steps:
- Ensure that serverless compute is enabled for your workspace in the account console under the Feature enablement tab.
- Verify that you have the necessary permissions to access serverless compute. Sometimes, specific roles or permissions are required.
- Ensure you are using the latest versions of Databricks CLI and VS Code extension using shell command:
-- Upgrade to latest version pip install --upgrade databricks-cli -- Verify the CLI configuration: databricks configure --token
- Double-check that the local environment variable
DATABRICKS_SERVERLESS_COMPUTE_ID
is set correctly. - Ensure that the modifications in the Databricks config file are correctly applied and saved.
- Verify that there are no cluster policies in place that might be restricting the visibility of serverless compute clusters.
- Verify that your network allows outbound traffic to Databricks and that firewall settings are not blocking traffic.
- Ensure you are using the correct syntax for initializing the Spark session from Python:
from databricks.connect import DatabricksSession as SparkSession spark = DatabricksSession.builder.serverless(True).getOrCreate()
- Refer to the official Databricks documentation and community forums for any similar issues and potential solutions.
- If none of the above steps resolve the issue, contact Databricks support for further assistance.
I hope this is helpful! Do not hesitate to let me know if you have any other questions.
Please don't forget to close up the thread here by upvoting and accept it as an answer if it is helpful.