Go to the google cloud Console.
Navigate to IAM & Admin - In the left sidebar, go to IAM & Admin > Service Accounts.
Create a New Service Account: Click on the "Create Service Account" button at the top.\
Fill in the Service Account Details:
Service account name: Give your service account a name.
Service account ID: This will be automatically generated based on the name.
Description: Optionally, provide a description for the service account.
Click "Create and Continue".
example:\
Assign Roles to the Service Account:
In the Grant this service account access to project step, you’ll assign the necessary roles.
Grant these role:
"storage object viewer" (read-only access)
Create the Service Account:
After assigning the roles, click "Done".
Generate and Download a Key:
Find your newly created service account, click the three dots on the right, and select "Manage Keys".
Click Add Key > Create New Key and choose the JSON format.
Download the key and store it securely, as it is used for authentication in your code or applications.
Encode the key in base 64:
use python function: put this function and your json (here named json_file.json) in the same directory and run.\
save the output printed.
Add the above 3 values into the appropriate fields:
Client_credentials_base64: pasting the output of 8.
Bucket: the bucket name.
Path: for default, fill with / else, put your path in the bucket. Seperate directories with /
Download and install the Google Cloud SDK from the Google Cloud SDK Install page. LINK
Select Your Platform (Windows, macOS, or Linux), download and run.
Initialize and Authenticate with Google Cloud: In the Cloud SDK Shell/terminal, run:
gcloud init
This will open a browser window to authenticate your Google account. Follow the instructions to log in and select your project.
Set CORS Configuration via gcloud:
Create a JSON file (cors.json
) on your machine with the CORS rules.
Example\ it should look like:
notice:
origin: if using Illumina cloud:
https://host_name.emg.illumina.com
else, Emedgene cloud:
https://host_name.emedgene.com
Apply CORS Configuration to Your Bucket: run the next command.
gcloud storage buckets update gs://your-bucket-name --cors-file=cors.json
Verify the CORS Configuration:
gcloud storage buckets describe gs://your-bucket-name