Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/google-cloud-platform/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Google cloud platform GCP:Cloud Function app.yaml环境变量格式问题文件_Google Cloud Platform_Yaml_Google Cloud Functions - Fatal编程技术网

Google cloud platform GCP:Cloud Function app.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

我试图使用“-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_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

谢谢-我错过了。谢谢-我错过了。