title: Permission denied during gcloud app deploy using Google Cloud SDK
body: <p>It is insanely hard, to deploy an app to Google App Engine, using Google Cloud SDK.</p>
  
  <p>I had tried the below 2 commands</p>
  
  <pre><code>C:\Users\yccheok\Desktop\jstock-android-appengine&gt;gcloud config set project jstock-android
  Updated property [core/project].
  
  C:\Users\yccheok\Desktop\jstock-android-appengine&gt;gcloud app deploy app.yaml --log-http --verbosity=debug
  DEBUG: Running [gcloud.app.deploy] with arguments: [--log-http: "true", --verbosity: "debug", DEPLOYABLES:1: "['app.yaml']"]
  DEBUG: No staging command found for runtime [python27] and environment [STANDARD].
  DEBUG: API endpoint: [https://appengine.googleapis.com/], API version: [v1]
  =======================
  ==== request start ====
  uri: https://appengine.googleapis.com/v1/apps/jstock-android?alt=json
  method: GET
  == headers start ==
  Authorization: Bearer ya29.GlxEBb1XVP1JK93-ARiaN_ZgiMbvZmw5KWfvJVfibDJ4FK_ZaMRoU1jVDTiWzsY606GSduJKJd9Nm8zA-_Iql5mGn4AMk4QVl8mPRycfekeZnOOHtbUvpkBMgOLOQA
  accept: application/json
  accept-encoding: gzip, deflate
  content-length: 0
  user-agent: google-cloud-sdk x_Tw5K8nnjoRAqULM9PFAC2b gcloud/184.0.0 command/gcloud.app.deploy invocation-id/c9ae232d33b346d787b95a36e28c38c0 environment/None environment-version/None interactive/True python/2.7.13 (Windows NT 10.0.16299)
  == headers end ==
  == body start ==
  
  == body end ==
  ==== request end ====
  ---- response start ----
  -- headers start --
  -content-encoding: gzip
  alt-svc: hq=":443"; ma=2592000; quic=51303431; quic=51303339; quic=51303338; quic=51303337; quic=51303335,quic=":443"; ma=2592000; v="41,39,38,37,35"
  cache-control: private
  content-length: 335
  content-type: application/json; charset=UTF-8
  date: Tue, 16 Jan 2018 19:16:21 GMT
  server: ESF
  status: 403
  transfer-encoding: chunked
  vary: Origin, X-Origin, Referer
  x-content-type-options: nosniff
  x-frame-options: SAMEORIGIN
  x-xss-protection: 1; mode=block
  -- headers end --
  -- body start --
  {
    "error": {
      "code": 403,
      "message": "Operation not allowed",
      "status": "PERMISSION_DENIED",
      "details": [
        {
          "@type": "type.googleapis.com/google.rpc.ResourceInfo",
          "resourceType": "gae.api",
          "description": "The \"appengine.applications.get\" permission is required."
        }
      ]
    }
  }
  
  -- body end --
  total round trip time (request+response): 1.796 secs
  ---- response end ----
  ----------------------
  DEBUG: (gcloud.app.deploy) Permissions error fetching application [apps/jstock-android]. Please make sure you are using the correct project ID and that you have permission to view applications on the project.
  Traceback (most recent call last):
    File "C:\Program Files (x86)\Google\Cloud SDK\google-cloud-sdk\lib\googlecloudsdk\calliope\cli.py", line 797, in Execute
      resources = calliope_command.Run(cli=self, args=args)
    File "C:\Program Files (x86)\Google\Cloud SDK\google-cloud-sdk\lib\googlecloudsdk\calliope\backend.py", line 757, in Run
      resources = command_instance.Run(args)
    File "C:\Program Files (x86)\Google\Cloud SDK\google-cloud-sdk\lib\surface\app\deploy.py", line 65, in Run
      parallel_build=False)
    File "C:\Program Files (x86)\Google\Cloud SDK\google-cloud-sdk\lib\googlecloudsdk\command_lib\app\deploy_util.py", line 543, in RunDeploy
      app = _PossiblyCreateApp(api_client, project)
    File "C:\Program Files (x86)\Google\Cloud SDK\google-cloud-sdk\lib\googlecloudsdk\command_lib\app\deploy_util.py", line 703, in _PossiblyCreateApp
      api_client._FormatApp())))  # pylint: disable=protected-access
  HttpException: Permissions error fetching application [apps/jstock-android]. Please make sure you are using the correct project ID and that you have permission to view applications on the project.
  ERROR: (gcloud.app.deploy) Permissions error fetching application [apps/jstock-android]. Please make sure you are using the correct project ID and that you have permission to view applications on the project.
  
  C:\Users\yccheok\Desktop\jstock-android-appengine&gt;
  </code></pre>
  
  <p>Then, I went through <a href="https://cloud.google.com/appengine/docs/admin-api/accessing-the-api" rel="noreferrer">https://cloud.google.com/appengine/docs/admin-api/accessing-the-api</a> , it mentioned I need to use <strong>Admin API</strong>. So, I do it step by step carefully.</p>
  
  <h2>Step 1</h2>
  
  <p><a href="https://i.stack.imgur.com/dRVVB.png" rel="noreferrer"><img src="https://i.stack.imgur.com/dRVVB.png" alt="enter image description here"></a></p>
  
  <h2>Step 2</h2>
  
  <p><a href="https://i.stack.imgur.com/LOm7K.png" rel="noreferrer"><img src="https://i.stack.imgur.com/LOm7K.png" alt="enter image description here"></a></p>
  
  <p>It mentions <strong>Admin API</strong> is enabled. Now I need credential.</p>
  
  <h2>Step 3</h2>
  
  <p><a href="https://i.stack.imgur.com/MuhA6.png" rel="noreferrer"><img src="https://i.stack.imgur.com/MuhA6.png" alt="enter image description here"></a></p>
  
  <h2>Step 4</h2>
  
  <p><a href="https://i.stack.imgur.com/6QUpo.png" rel="noreferrer"><img src="https://i.stack.imgur.com/6QUpo.png" alt="enter image description here"></a></p>
  
  <p>OK. Now they mention I don't need create new credential. I can use <strong>Application Default Credentials</strong> ?!</p>
  
  <h2>Step 5</h2>
  
  <p>So, I went to <a href="https://developers.google.com/identity/protocols/application-default-credentials?hl=en_GB" rel="noreferrer">https://developers.google.com/identity/protocols/application-default-credentials?hl=en_GB</a> . I learn that I need to run</p>
  
  <pre><code>C:\Users\yccheok\Desktop\jstock-android-appengine&gt;gcloud auth application-default login
  Your browser has been opened to visit:
  
      https://accounts.google.com/o/oauth2/auth?redirect_uri=http%3A%2F%2Flocalhost%3A8085%2F&amp;prompt=select_account&amp;response_type=code&amp;client_id=764086051850-6qr4p6gpi6hn506pt8ejuq83di341hur.apps.googleusercontent.com&amp;scope=https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fuserinfo.email+https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fcloud-platform&amp;access_type=offline
  
  
  
  Credentials saved to file: [C:\Users\yccheok\AppData\Roaming\gcloud\application_default_credentials.json]
  
  These credentials will be used by any library that requests
  Application Default Credentials.
  </code></pre>
  
  <h2>Step 6</h2>
  
  <p><a href="https://i.stack.imgur.com/TJsIP.png" rel="noreferrer"><img src="https://i.stack.imgur.com/TJsIP.png" alt="enter image description here"></a></p>
  
  <h2>Step 7</h2>
  
  <p><a href="https://i.stack.imgur.com/cNo3x.png" rel="noreferrer"><img src="https://i.stack.imgur.com/cNo3x.png" alt="enter image description here"></a></p>
  
  <hr>
  
  <p>Still, after completing the above 7 steps, I still get the exact same error message, when trying to run</p>
  
  <pre><code>gcloud app deploy app.yaml --log-http --verbosity=debug
  </code></pre>
  
  <p>Can anyone let me know, what step I'm still require, in order to deploy my Python app to Google App Engine, using Google Cloud SDK?</p>