title: "ERROR: (gcloud.functions.call) ResponseError: status=[404], code=[Ok], message=[Function XYZ in region us-central1 in project ABC does not exist]"
body: <p>I am testing a cloud function.</p>
  <p>When I run it from the &quot;Testing&quot; tab, online, and I paste the json dictionary as the argument to be passed as the request variable of the cloud function in the &quot;Triggering event&quot; editor as:</p>
  <pre><code>{&quot;api_key&quot;:&quot;MY_API_KEY&quot;}
  </code></pre>
  <p>(with MY_API_KEY to be replaced with a plain text key) then the function runs through.</p>
  <p>From bash, using <code>gcloud</code> instead, the same function fails with:</p>
  <pre><code>gcloud functions call MY_CLOUD_FUNCTION --data '{&quot;api_key&quot;:&quot;$API_KEY&quot;}'
  </code></pre>
  <blockquote>
  <pre class="lang-sh prettyprint-override"><code>gcloud functions call MY_CLOUD_FUNCTION --data '{&quot;api_key&quot;:&quot;$API_KEY&quot;}' 
  ERROR: (gcloud.functions.call) ResponseError:
  status=[404], code=[Ok], message=[Function MY_CLOUD_FUNCTION in region
  us-central1 in project MY_CLOUD_PROJECT does not exist]
  </code></pre>
  </blockquote>
  <p>And this is most likely not a problem of the triggering event which just happens to be part of the args but should not play a role here. It is a problem of the different regions. <code>gcloud</code> expects the default region <code>us-central1</code> while my function is <code>europe-west3</code> (from the &quot;Details&quot; tab).</p>
  <p>How can I tell <code>gcloud</code> to use the region of the function, and not the default region? Or what would be another way to fix this?</p>