Airflow でジョブを実行するときの Invalid Access Token
エラーInvalid Access Token
error when running jobs with Airflow
問題Problem
スケジュールされた通気 Azure Databricks ジョブを実行すると、次のエラーが表示されます。When you run scheduled Airflow Azure Databricks jobs, you get this error:
Invalid Access Token : 403 Forbidden Error
原因Cause
エアフローを通じて Azure Databricks ジョブを実行またはスケジュールするには、通気 web UI を使用して Azure Databricks 接続を構成する必要があります。To run or schedule Azure Databricks jobs through Airflow, you need to configure the Azure Databricks connection using the Airflow web UI. 次のいずれかの間違った設定を行うと、エラーが発生する可能性があります。Any of the following incorrect settings can cause the error:
- フィールドを
host
Azure Databricks ワークスペースのホスト名に設定します。Set thehost
field to the Azure Databricks workspace hostname. login
フィールドをtoken
に設定します。Set thelogin
field totoken
.- フィールドに、Azure Databricks によっ
password
て生成される個人用アクセストークンを設定します。Set thepassword
field to the Azure Databricks-generated personal access token. - フィールドに
Extra
JSON 文字列を設定します。ここで、キーはで、token
値は個人用アクセストークンです。Set theExtra
field to a JSON string, where the key istoken
and the value is your personal access token.
Azure Databricks 生成された個人用アクセストークンは、通常、90日間有効です。The Azure Databricks-generated personal access token is normally valid for 90 days. トークンの有効期限が切れると、この 403 Forbidden Error
エラーが発生します。If the token expires, then this 403 Forbidden Error
occurs.
解決策Solution
フィールドが JSON 文字列を使用して正しく構成されていることを確認し
Extra
ます。Verify that theExtra
field is correctly configured with the JSON string:{"token": "<your personal access token>"}
フィールドとフィールドの両方にトークンが記述されていることを確認し
password
Extra
ます。Verify that the token is mentioned in both thepassword
field and theExtra
field.host
、login
、およびのpassword
各フィールドが正しく構成されていることを確認します。Verify that thehost
,login
, andpassword
fields are configured correctly.個人用アクセストークンの有効期限が切れていないことを確認します。Verify that the personal access token has not expired.
必要に応じて、 新しいトークンを生成します。If necessary, generate a new token.