我正在尝试以自动化方式创建数据工具链。我正在使用 Azure,databricks-cli。 https://github.com/Azure-Samples/modern-data-warehouse-dataops/blob/main/e2e_samples/parking_sensors/scripts/deploy_infrastructure.sh
我在使用 aad 令牌对数据进行身份验证时遇到问题,生成 PAT。
echo "Generate Databricks token"
databricks_host=https://$(echo "$arm_output" | jq -r '.properties.outputs.databricks_output.value.properties.workspaceUrl')
databricks_workspace_resource_id=$(echo "$arm_output" | jq -r '.properties.outputs.databricks_id.value')
databricks_aad_token=$(az account get-access-token --resource 2ff814a6-3304-4ab8-85cb-cd0e6f879c1d --output json | jq -r .accessToken) # Databricks app global id
这给我带来了问题。
# Use AAD token to generate PAT token
databricks_token=$(DATABRICKS_TOKEN=$databricks_aad_token \
DATABRICKS_HOST=$databricks_host \
bash -c "databricks tokens create --comment 'deployment'" | jq -r .token_value)
如何对databricks进行身份验证以便能够使用databricks cli?
后来我试图创建秘密,但由于我没有经过身份验证而失败。
# Create secret scope
databricks secrets create-scope --scope "$scope_name" \
--scope-backend-type AZURE_KEYVAULT \
--resource-id "$KEYVAULT_RESOURCE_ID" \
--dns-name "$KEYVAULT_DNS_NAME"
谢谢 Alex,不幸的是它仍然无法在 Azure 上运行。系统:
az login - as subscription owner done
databricks -v
Version 0.16.4
export DATABRICKS_HOST='https://xxx-xxx.16.azuredatabricks.net'
export DATABRICKS_TOKEN=$(az account get-access-token --resource 2ff814a6-3304-4ab8-85cb-cd0e6f879c1d --output json | jq -r .accessToken)
第一次尝试:
databricks tokens list
Error: b'<html>\n<head>\n<meta http-equiv="Content-Type" content="text/html;charset=utf-8"/>\n<title>Error 403 User not authorized.</title>\n</head>\n<body><h2>HTTP ERROR 403</h2>\n<p>Problem accessing /api/2.0/token/list. Reason:\n<pre> User not authorized.</pre></p>\n</body>\n</html>\n'
第二次尝试:
databricks secrets create-scope --scope "XXX" --scope-backend-type AZURE_KEYVAULT --resource-id "$KEYVAULT_RESOURCE_ID" --dns-name "$KEYVAULT_DNS_NAME"
Error: b'<html>\n<head>\n<meta http-equiv="Content-Type" content="text/html;charset=utf-8"/>\n<title>Error 403 User not authorized.</title>\n</head>\n<body><h2>HTTP ERROR 403</h2>\n<p>Problem accessing /api/2.0/secrets/scopes/create. Reason:\n<pre> User not authorized.</pre></p>\n</body>\n</html>\n