Skip to content Skip to sidebar Skip to footer

Generating Cloud Storage Signed Url From Google Cloud Function Without Using Explicit Key File

I'd like to create a pre-signed upload URL to a storage bucket, and would like to avoid an explicit reference to a json key. Currently, I'm attempting to do this with the Default A

Solution 1:

When you use version v4 of signed URL, the first line of the method calls ensure_signed_credentialsmethod that check if the current service account can generate a signature in standalone mode (so with a private key). And so, that's break the current behavior.

In the comment of the function, it's clearly describe that a service account JSON file is required

If you are on Google Compute Engine, you can't generate a signed URL.
        Follow `Issue 922`_ for updates on this. If you'd like to be able to
        generate a signed URL from GCE, you can use a standard service account
        from a JSON file rather than a GCE service account.

So, use v2 version instead.

Post a Comment for "Generating Cloud Storage Signed Url From Google Cloud Function Without Using Explicit Key File"