title: Trying to run gsutil rsync command using BashOperator in Airflow, authentication issues
body: <p>I am trying to run a simple <code>gsutil rsync</code> command in Airflow 1.10.10 using a <code>BashOperator</code>. I am getting the following error when executing the command:</p>
  <pre><code>gsutil ServiceException: 401 Anonymous caller does not have storage.objects.list access to bucket
  </code></pre>
  <p>I have tried placing the credential file in and using this:</p>
  <pre><code>os.environ[&quot;GOOGLE_APPLICATION_CREDENTIALS&quot;]=&quot;/folder/path/credentials.json&quot;
  </code></pre>
  <p>And I have also read through this document: <a href="https://cloud.google.com/storage/docs/gsutil_install#authenticate" rel="nofollow noreferrer">https://cloud.google.com/storage/docs/gsutil_install#authenticate</a></p>
  <p>The problem is that I cannot login using a browser or in any other interactive way because the Airflow setup code will run in a Docker container on AWS EKS. There's no feasible way to manually copy and paste verification codes. So I don't think any of the Google docs are helpful.</p>
  <p>I have also tried the solutions here: <a href="https://stackoverflow.com/questions/49302859/gsutil-serviceexception-401-anonymous-caller-does-not-have-storage-objects-list">gsutil ServiceException: 401 Anonymous caller does not have storage.objects.list access to bucket even though I&#39;m loggedin in gcloud</a>, specifically the solutions which asked me to run these two lines:</p>
  <pre><code>gcloud auth login
  gcloud auth application-default login
  </code></pre>
  <p>So in my Dockerfile, I wrote <code>RUN pip install gcloud</code> and it installed correctly, but when I try to run the two commands above, it says <code>bash: gcloud: command not found</code>.</p>
  <p>Why is gcloud installing, but not allowing me to run commands? Is there any way to get this working on a container where I cannot open a browser nor copy/paste verification codes?</p>