title: How to run a Cloud Scheduler job with App Engine HTTP when protected by IAP
body: <p>I have a Python app on Google App Engine Standard which is secured using Google Cloud Identity Aware Proxy (IAP).</p>
  <p>I would like to trigger a part of my app every day by using Cloud Scheduler. (It is calling an API, doing calculations, and stores results in Google Cloud Storage.)</p>
  <p>To do so, I tried triggering a POST request on an &quot;App Engine HTTP&quot;. example URL: &quot;/refresh_data&quot;</p>
  <p>When running the job, I get the following error:</p>
  <pre><code>jsonPayload: {
  status: &quot;FAILED_PRECONDITION&quot;
  relativeUrl: &quot;/refresh_data&quot;
  jobName: &quot;...&quot;
  @type: &quot;type.googleapis.com/google.cloud.scheduler.logging.AttemptFinished&quot;
  targetType: &quot;APP_ENGINE_HTTP&quot;
  }
  </code></pre>
  <p>I can't find any documentation relative to the &quot;FAILED_PRECONDITION&quot; error so I'm feeling kind of stuck here.</p>
  <p>As an alternative, I tried to trigger a POST request to a simple &quot;HTTP&quot; and by granting the Owner access level in IAP to the service account I am using for Cloud Scheduler. This time, the error message I get is the following :</p>
  <pre><code> jsonPayload: {
   status: &quot;UNAUTHENTICATED&quot;
   @type: &quot;type.googleapis.com/google.cloud.scheduler.logging.AttemptFinished&quot;
   jobName: &quot;...&quot;
   targetType: &quot;HTTP&quot;
   url: &quot;https:.../refresh_data&quot;
   }
  </code></pre>
  <p>I really don't understand how to make this work... The <a href="https://cloud.google.com/scheduler/docs/creating" rel="nofollow noreferrer">Cloud Scheduler documentation</a> barely documents the &quot;App Engine HTTP&quot; option, and nothing is documented relative to te use of IAP...</p>
  <p>Any help would be much appreciated :)</p>