I'm trying to make an excel file I upload to Firebase storage (google cloud storage) publicly available as a link. When I use the method blob.make_public()
I get a Forbidden 403 error: Insufficient permission.
I'm using the Firebase Admin SDK for python. As far as I can tell in the IAM part of the cloud console the admin SDK has Editor and Storage Object Admin roles. Any way to make the uploaded object public through python?
Haven't found anything else that works in the docs: Python GCS API
Thanks.
Code example
# Access google cloud storage bucket
bucket = firebase_admin.storage.bucket(app=app)
# Blob - Google's wrapper for objects stored in buckets
destination_blob_name = 'excelReports/' + filename + '_' + datetime.now().strftime("%b_%d_%Y_%H_%M_%S")
blob = bucket.blob(destination_blob_name)
# Upload file
blob.upload_from_filename(filename)
# Make the file available for public download by those who have the link.
blob.make_public()