admin管理员组文章数量:1391767
I am deploying a Flask application to Google App Engine (Standard Environment, Python 3.9). I am using Firebase Admin SDK to access Firestore, and I have set GOOGLE_APPLICATION_CREDENTIALS in app.yaml to point to my service account JSON file (firebase_credentials.json).
However, after deploying the app, running:
gcloud app describe --format=json | jq '.envVariables'
returns:
null
i
ndicating that the environment variable has not been set correctly.
Additionally, my Flask debug endpoint:
import os
from flask import jsonify
@app.route("/debug")
def debug():
file_exists = os.path.exists("./firebase_credentials.json")
return jsonify({
"GOOGLE_APPLICATION_CREDENTIALS": os.getenv("GOOGLE_APPLICATION_CREDENTIALS"),
"firebase_credentials_exists": file_exists
}), 200
returns:
{
"GOOGLE_APPLICATION_CREDENTIALS": null,
"firebase_credentials_exists": true
}
This confirms that the service account file is present in the App Engine instance but the environment variable is missing.
本文标签: pythonGOOGLEAPPLICATIONCREDENTIALS is null even after setting envvariables in appyamlStack Overflow
版权声明:本文标题:python - GOOGLE_APPLICATION_CREDENTIALS is null even after setting env_variables in app.yaml - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744772391a2624417.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论