Search This Blog

Simple way to generate JSON key for google service account

 Cloud technologies became one of the important skill sets in the job market nowadays. It could be Google Cloud, Microsoft Azure, or Amazon cloud technologies. In this article, we will learn the easy way to generate JSON key files for a Google service account. 

1. Go to service accounts under IAM & Admin menu

After opening Google Cloud Console, Click on the 3 horizontal lines next to Google Cloud in the top left corner, Later click on the IAM and Admin menu from there go to service accounts and click on it.
Select relevant Google cloud project if already not done.

locate service accounts options under Iam and admin menu in the google cloud
Locate service accounts under IAM & Admin

2.  Create a new service account

From here, We have two options for generating JSON files for service accounts.  We can generate JSON files for existing service accounts or We can create a service account and generate JSON key file for that. We will see both options in this article. First We will create a service account and then go to JSON key file generation.

in the middle of the page, We will see Create service account option, click on that.

Create a service account under IAM and Admin in the google cloud


3.  Enter Service account details

Enter a name for the service account, and the service ID is auto-generated. You can enter some text as a description for the service account.
Service account name, ID, and Description in the google cloud

for example, This service account is used for Airflow

4. Choose Roles for the Service account

In the second step, you can also select some roles for the gcloud service account. for example, we have selected a browser role for our service account dummy.


Now click on done, and a service account called dummy is created for you. We have several other options while creating a service account, we will cover them in another article.

5. JSON key generation

Now Go to the service account you just created and click on the keys menu and also click on the add key option

Keys for the service accountin google cloud

From there choose to create a new key option.

JSON option is auto-selected and we just need to click on the create option. 
JSON file is created and auto-downloaded to the local downloads folder.

Json key generation for a service account in the Google Cloud

This JSON file is used in several places for authentication. for example, you can use this JSON file in Tableau software to authenticate and also we can use this JSON file in the Python program to authenticate to google cloud services.

Let me know if you have any queries. You can also check this video  for the same help.





No comments:

Post a Comment