Azure-Samples / modern-data-warehouse-dataops

DataOps for Microsoft Data Platform technologies. https://aka.ms/dataops-repo
MIT License
588 stars 459 forks source link

Parking Sensor (Databricks) deployment fails due to change in behaviour of workspace startup #630

Closed devlace closed 3 days ago

devlace commented 1 year ago

Description

Deployment fails with parse error: Invalid numeric literal at line 1, column 6".

++ DATABRICKS_HOST=https://adb-<workspace_id>.xx.azuredatabricks.net
++ bash -c 'databricks tokens create --comment '\''deployment'\'''
++ jq -r .token_value
parse error: Invalid numeric literal at line 1, column 6
+ databricks_token=

Root Cause: The error message is a generic error that hides the real error message of "Error: Authorization failed. Your token may be expired or lack the valid scope".

This appears to be a cold start problem with the Azure Databricks workspace. When deploying an Azure Databricks workspace, the workspace needs to be manually launched first in the Azure portal before the API calls are permitted.

Workaround:

When you encounter the error, manually launch the Databricks workspace, then re-run the deployment script (deploy.sh). Ensure you have set the DEPLOYMENT_ID environment variable. The script is designed to be idempotent to each deployment determined by the DEPLOYMENT_ID.

Note, if you don't set the DEPLOYMENT_ID variable, the deploy.sh script will simply create a fresh deployment with an random deployment_id which will fail instead of targeting your previous deployment.

Expected Behavior

Parking Sensor (databricks) deploys successfully.

Reproduce

Deploy the Parking Sensor Databricks as per instructions.

Additional Context