title: How to set environment variables using Google Cloud Build or other method in Google App Engine Standard Environment?
body: <p>Is there anyway to inject environment variables from Cloud Build into the App Engine Standard environment? </p>
  
  <p>I do not want to push my environment variables to GitHub inside the <code>app.yaml</code> or <code>.env</code>. Thus, when Cloud Build pulls and deploys it is missing the <code>.env</code> file and the server is unable to complete some requests. </p>
  
  <p>I am trying to avoid using Datastore as the async nature of Datastore will make the code a lot more messy. I tried to use encrypted secrets found <a href="https://cloud.google.com/cloud-build/docs/securing-builds/use-encrypted-secrets-credentials" rel="noreferrer">here</a>, but that doesn't seem to work as I added the secrets to app deploy and they do not make their way into the deployment, so I assume this is not the use case for Cloud Build.</p>
  
  <p>I also tried the tutorial <a href="http://gunargessner.com/gcloud-env-vars/" rel="noreferrer">here</a>, to import the <code>.env</code> file into App Engine Standard from storage, but since Standard does not have local storage I assume it goes into the void.</p>
  
  <p>So is there anyway to inject the <code>.env</code> into App Engine Standard environment without using Datastore, or committing <code>app.yaml</code> or <code>.env</code> to change control? Potentially using Cloud Build, KMS, or some type of storage?</p>
  
  <p>Here is what I tried for <code>cloudbuild.yaml</code>:</p>
  
  <pre><code>steps:
  - name: "gcr.io/cloud-builders/gcloud"
    args: ["app", "deploy"]
    secretEnv: ['SECRET1', 'SECRET2', 'SECRET3', 'SECRET4', 'SECRET5']
  timeout: "1600s"
  
  secrets:
  - kmsKeyName: projects/&lt;Project-Name&gt;/locations/global/keyRings/&lt;Key-Ring-Name&gt;/cryptoKeys/&lt;Key-Name&gt;
    secretEnv:
      SECRET1: &lt;encrypted-key-base64 here&gt;
      SECRET2: &lt;encrypted-key-base64 here&gt;
      SECRET3: &lt;encrypted-key-base64 here&gt; 
      SECRET4: &lt;encrypted-key-base64 here&gt; 
      SECRET5: &lt;encrypted-key-base64 here&gt;
  </code></pre>