According to the documentation, in order to be able to read from an Object stored in Google Cloud Storage, you need to have the proper permissions. In your case it is the: storage.objects.get
.
In GCP, service accounts are by between services to communicate between each other in the cloud with the right permissions. Thus, the Jupyter notebook uses a service account to access the object gs://bank-modelling-project//training_data.xlsx
in GCS. So it needs the storage.objects.get
permission to read the object.
Below are the steps to assign this permission to your service account:
- Go to your notebooks instance page and click on the instance you are using;
- Under Instance properties, check the Service account;
- Now go to IAM & ADMIN and find the service account you saw in the previous step;
- On the same line as its name, click on the Pencil icon to edit the member;
- Add the pre-defined role Storage Object Viewer, because this role has the permission you need, such as described here.
- Re-open your notebook instance and you will be able to read the GCS object you desire.
Please note that you won't be able to create any object in GCS with only this permission.