For the default Requests-compatible google.cloud.storage.Client transport, set the proxy before launching the Python job:

export HTTPS_PROXY=http://proxy.example:8080
python storage_job.py

The job can keep its normal client construction when the project and credentials are already configured:

from google.cloud import storage

client = storage.Client()

HTTPS_PROXY selects HTTPS destination requests. The value's http:// scheme names the intermediary protocol, so it does not downgrade the Cloud Storage endpoint. For a public HTTP route, take the endpoint address from the HTTP proxy list and leave the Cloud Storage URL unchanged.

If the job still uses another route, inspect that Python process's environment, including NO_PROXY. A running notebook kernel or service does not acquire a later export from a separate terminal. Check its CA configuration when the failure is certificate-related.

A working gcloud command is a different comparison: it can use another configuration path. Likewise, a custom HTTP session or replacement transport supplied by the application needs its own proxy policy.

Related articles