Hello,
I am trying to connect to my Google Ads Seat through Google Ads API.
I have the simple following code to authenticate.
###
from google.ads.googleads.client import GoogleAdsClient
DEVELOPER_TOKEN = "xxxx" => Developer token in string
USE_PROTO_PLUS = "true"
JSON_KEY_FILE_PATH = '/app/service-account.json' ==> the absolute path in string of the service account json file within the docker image which has been authorized for adwords scope
IMPERSONATED_EMAIL = "
em...@gmail.com" ==> the email of the admin on this service account in string
LOGIN_CUSTOMER_ID = "0123456789" ==> The ID in string of my Google Ads Seat
credentials = {
"developer_token": DEVELOPER_TOKEN ,
"use_proto_plus": USE_PROTO_PLUS ,
"json_key_file_path": JSON_KEY_FILE_PATH ,
"impersonated_email": IMPERSONATED_EMAIL ,
"login_customer_id": LOGIN_CUSTOMER_ID
}
client = GoogleAdsClient.load_from_dict(credentials)
###
When I run it locally it works perfectly (in locally deployed docker image). However, when my application is deployed on Cloud Run and run in docker image on Google Cloud Platform I have the following error : "[Errno 21] Is a directory: '/app/service-account.json' ".
I am kind of lost because this code works perfectly locally. I don't understand why it's reading this JSON_KEY_FILE_PATH variable as a directory and not as a path since it has the .json extension.
The file is well existing in the docker image.
Do you know where this could come from ?
I have already ask for help on the Google Ads forum but they said it would rather be a GCP issue.
Thanks in advance,
Adelaide