'How to add a scope to an app engine instance?

I'm trying to use start a csv file import to cloud sql from an app engine as described here.

Although this works locally, it fails when running on app engine:

googleapiclient.errors.HttpError: <HttpError 403 when requesting https://sqladmin.googleapis.com/v1/projects/xxxxxx/instances/yyyyyy/import?alt=json 
returned "Request had insufficient authentication scopes."
Details: "[{'message': 'Insufficient Permission', 'domain': 'global', 'reason': 'insufficientPermissions'}]">"

How to add the scopes to my app engine standard instance?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source