title: How can I give my Google Cloud App Engine access to my Firebase Storage bucket
body: <p>I'm getting an error: <code>API error 7 (images: ACCESS_DENIED)</code></p>
  
  <p>Normally I would have the Firebase app associated with my Google App Engine service, but since Firestore is not compatible with App Engine, I have to create seperate instances of the service.  However, now I need my app engine image service to be able to reference the files in the firebase cloud storage folder.  How do I set up access, would I need to create some sort of IAM that's shared across both services? </p>
  
  <p>Example of my app-engine go function referencing the firebase storage bucket <code>the-other-firebase-app</code></p>
  
  <pre><code>func photoHandler(w http.ResponseWriter, r *http.Request) {
  
      c := appengine.NewContext(r)
      v := r.URL.Query()
      fileName := v.Get("file")
      if (fileName == "") {
          fmt.Fprint(w, "file name is required")
      } else {
          filename := "/gs/the-other-firebase-app.appspot.com/photos/" + fileName;
          blobKey,err := blobstore.BlobKeyForFile(c, filename)
          if (err == nil) {
              url, urlErr := image.ServingURL(c, blobKey, nil)
              if (urlErr == nil) {
                  fmt.Fprint(w, url)
              } else {
                  fmt.Fprint(w, urlErr)
              }
          } else {
              fmt.Fprint(w, "image does not exist")
          }
      }  
  }
  </code></pre>