title: Google Cloud BigQuery Admin service account gets "does not have bigquery.jobs.create permission"
body: <p>I'm new to Google Cloud &amp; BigQuery. I reviewed the dozen other questions that seem to be related and have not seen what I'm missing from those answers. I'm trying to query a public dataset.</p>
  
  <p>The error:</p>
  
  <pre><code>Caused by: com.google.api.client.googleapis.json.GoogleJsonResponseException: 403 Forbidden
  {
    "code" : 403,
    "errors" : [ {
      "domain" : "global",
      "message" : "Access Denied: Project airy-advantage-235802: The user kafka-learning@airy-advantage-235802.iam.gserviceaccount.com does not have bigquery.jobs.create permission in project airy-advantage-235802.",
      "reason" : "accessDenied"
    } ],
    "message" : "Access Denied: Project airy-advantage-235802: The user kafka-learning@airy-advantage-235802.iam.gserviceaccount.com does not have bigquery.jobs.create permission in project airy-advantage-235802."
  }
      at com.google.api.client.googleapis.json.GoogleJsonResponseException.from(GoogleJsonResponseException.java:150)
      at com.google.api.client.googleapis.services.json.AbstractGoogleJsonClientRequest.newExceptionOnError(AbstractGoogleJsonClientRequest.java:113)
      at com.google.api.client.googleapis.services.json.AbstractGoogleJsonClientRequest.newExceptionOnError(AbstractGoogleJsonClientRequest.java:40)
      at com.google.api.client.googleapis.services.AbstractGoogleClientRequest$1.interceptResponse(AbstractGoogleClientRequest.java:401)
      at com.google.api.client.http.HttpRequest.execute(HttpRequest.java:1132)
      at com.google.api.client.googleapis.services.AbstractGoogleClientRequest.executeUnparsed(AbstractGoogleClientRequest.java:499)
      at com.google.api.client.googleapis.services.AbstractGoogleClientRequest.executeUnparsed(AbstractGoogleClientRequest.java:432)
      at com.google.api.client.googleapis.services.AbstractGoogleClientRequest.execute(AbstractGoogleClientRequest.java:549)
      at com.google.cloud.bigquery.spi.v2.HttpBigQueryRpc.create(HttpBigQueryRpc.java:183)
  </code></pre>
  
  <p>What I've done:</p>
  
  <ol>
  <li>Created new Google Cloud account</li>
  <li>Created new project, which Google assigned the project ID airy-advantage-235802, project name is Kafka Learning.</li>
  <li>Created a service account kafka-learning@airy-advantage-235802.iam.gserviceaccount.com</li>
  <li>Granted that user the BigQuery Admin role within the project (I originally tried BigQuery User and BigQuery Data Viewer)</li>
  <li>I saved the JSON credentials file to a local folder</li>
  <li>I set the environment variable <code>GOOGLE_APPLICATION_CREDENTIALS</code> to the path to the JSON file</li>
  <li>I have a <a href="https://github.com/samuelneff/kafka-learning/blob/75d436cf0590401a7b3f8f10e4422448100da33c/bigquery-producer/src/main/java/com/serndesign/kafka/learning/bigqueryProducer/App.java" rel="nofollow noreferrer">tiny Java project to query a public dataset</a></li>
  <li>Received above error</li>
  <li>Verified billing is enabled (as far as I can tell, see below)</li>
  </ol>
  
  <p>Is there a step I missed?</p>
  
  <p><a href="https://i.stack.imgur.com/Smxg5.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Smxg5.png" alt="Google Cloud Project setup"></a></p>
  
  <p><a href="https://i.stack.imgur.com/caKa2.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/caKa2.png" alt="Service Account Setup"></a></p>
  
  <p><a href="https://i.stack.imgur.com/kSbnw.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/kSbnw.png" alt="enter image description here"></a></p>
  
  <pre><code>var bigquery = BigQueryOptions.getDefaultInstance().getService();
  var query = "SELECT * FROM `bigquery-public-data.google_analytics_sample.ga_sessions_20160801` LIMIT 10";
  var queryConfig = QueryJobConfiguration.newBuilder(query).build();
  var table = bigquery.query(queryConfig);
  </code></pre>
  
  <p>I've also tried explicitly setting the project id (which is also in the json file) by changing the builder to this:</p>
  
  <pre><code>var bigquery = BigQueryOptions.newBuilder().setProjectId("airy-advantage-235802").build().getService();
  </code></pre>