0

When i run commands from google sdk Shell, i got no error :

# login
gcloud auth login
# upload files to bucket : google cloud storage
gsutil cp "My_File_Path" gs://"My_Bucket_Name

When i run the same commands from windows cmd, i got error : AccessDeniedException: 403 Insufficient Permission

I'm willing to run the commands from windows cmd so i can automate it easily on my python script using :

import os
os.system("gcloud auth login")
os.system("gsutil cp 'Path_To_File' gs://'Bucket_Name'")

On windows cmd : os.system("gcloud auth login") runs without errors, second command get the error : AccessDeniedException: 403 Insufficient Permission

ibrahim
  • 17
  • 5

1 Answers1

0

gcloud auth login is generating a link that you have to follow to authenticate into Coud SDK. So it probably can be run without authentication error, as it only returns a link and is waiting for verification code. But running this gsutil needs authenticated Cloud SDK.

If you need to upload file using Python, I think that better way to use Python API. There is very nice example in Google documentation. If you want to setup Python API authentication you need to setup environment variables as explained in this article.

Please take a look at this question as well.

vitooh
  • 4,132
  • 1
  • 5
  • 16