Google cloud platform GCP:Cloud Function app.yaml环境变量格式问题文件
我试图使用“-env vars file”标志部署一个GCP云函数,并指定一个YAML文件来包含变量。我的'app-dev.yaml'yaml文件如下所示:Google cloud platform GCP:Cloud Function app.yaml环境变量格式问题文件,google-cloud-platform,yaml,google-cloud-functions,Google Cloud Platform,Yaml,Google Cloud Functions,我试图使用“-env vars file”标志部署一个GCP云函数,并指定一个YAML文件来包含变量。我的'app-dev.yaml'yaml文件如下所示: runtime: python37 api_version: '1' threadsafe: 'true' env_variables: VAR_1: 'var_1_value' VAR_2: 'var_2_value' VAR_3: 'var_3_value' gcloud functions deploy my_clou
runtime: python37
api_version: '1'
threadsafe: 'true'
env_variables:
VAR_1: 'var_1_value'
VAR_2: 'var_2_value'
VAR_3: 'var_3_value'
gcloud functions deploy my_cloud_function --env-vars-file app-dev.yaml --runtime python37 --trigger-resource my-project.appspot.com --trigger-event google.storage.object.finalize
我部署的gcloud函数如下所示:
runtime: python37
api_version: '1'
threadsafe: 'true'
env_variables:
VAR_1: 'var_1_value'
VAR_2: 'var_2_value'
VAR_3: 'var_3_value'
gcloud functions deploy my_cloud_function --env-vars-file app-dev.yaml --runtime python37 --trigger-resource my-project.appspot.com --trigger-event google.storage.object.finalize
现在,当我运行此命令时,返回以下错误:
gcloud崩溃(ValidationError):的预期类型
字段值,找到{'VAR_1':'VAR_1_值','VAR_2':'VAR_2_值',
“VAR_3”:“VAR_3_值”}(类型
)
但是根据app-dev.yaml格式应该可以
感谢您的帮助。
谢谢您提供的链接引用了app Engine中所需的
app.yaml
文件,与此无关
根据Cloud Functions文档,.env.yaml
文件应具有以下格式:
VAR_1: var_1_value
VAR_2: var_2_value
VAR_3: var_3_value
您提供的链接引用了app Engine中所需的
app.yaml
文件,与此无关
根据Cloud Functions文档,.env.yaml
文件应具有以下格式:
VAR_1: var_1_value
VAR_2: var_2_value
VAR_3: var_3_value
谢谢-我错过了。谢谢-我错过了。