Is there a way calling FindDefaultCredentials successfully using 2nd gen local app engine (dev_appserver.py)?











up vote
1
down vote

favorite












I'm developing an app engine application using the "go111" runtime. According to Migrating your App Engine app from Go 1.9 to Go 1.11 the datastore should be done using package datastore. However, calling google.FindDefaultCredentials fails with "could not find default credentials".
Any ideas how to access the cloud datastore using default credentials?










share|improve this question
























  • Have you tried using google.DefaultCredentials? I thought the FindDefaultCredentials method was more for the flex env, but it looks like you might be using the standard env.
    – poy
    Nov 16 at 21:59















up vote
1
down vote

favorite












I'm developing an app engine application using the "go111" runtime. According to Migrating your App Engine app from Go 1.9 to Go 1.11 the datastore should be done using package datastore. However, calling google.FindDefaultCredentials fails with "could not find default credentials".
Any ideas how to access the cloud datastore using default credentials?










share|improve this question
























  • Have you tried using google.DefaultCredentials? I thought the FindDefaultCredentials method was more for the flex env, but it looks like you might be using the standard env.
    – poy
    Nov 16 at 21:59













up vote
1
down vote

favorite









up vote
1
down vote

favorite











I'm developing an app engine application using the "go111" runtime. According to Migrating your App Engine app from Go 1.9 to Go 1.11 the datastore should be done using package datastore. However, calling google.FindDefaultCredentials fails with "could not find default credentials".
Any ideas how to access the cloud datastore using default credentials?










share|improve this question















I'm developing an app engine application using the "go111" runtime. According to Migrating your App Engine app from Go 1.9 to Go 1.11 the datastore should be done using package datastore. However, calling google.FindDefaultCredentials fails with "could not find default credentials".
Any ideas how to access the cloud datastore using default credentials?







google-app-engine go credentials






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited 2 days ago

























asked Nov 16 at 21:27









Robert

7110




7110












  • Have you tried using google.DefaultCredentials? I thought the FindDefaultCredentials method was more for the flex env, but it looks like you might be using the standard env.
    – poy
    Nov 16 at 21:59


















  • Have you tried using google.DefaultCredentials? I thought the FindDefaultCredentials method was more for the flex env, but it looks like you might be using the standard env.
    – poy
    Nov 16 at 21:59
















Have you tried using google.DefaultCredentials? I thought the FindDefaultCredentials method was more for the flex env, but it looks like you might be using the standard env.
– poy
Nov 16 at 21:59




Have you tried using google.DefaultCredentials? I thought the FindDefaultCredentials method was more for the flex env, but it looks like you might be using the standard env.
– poy
Nov 16 at 21:59












1 Answer
1






active

oldest

votes

















up vote
0
down vote













Set the GOOGLE_APPLICATION_CREDENTIALS environment variable before starting your application.



With the second generation runtime, if you aren't using any google.golang.org/appengine APIs, you do not need to use dev_appserver.py -- you can build and start your application normally (go build and/or go run).



Also, it's very uncommon to explicitly pass the credentials. cloud.google.com/go APIs should all automatically find your credentials for you. When you're running locally, setting the GOOGLE_APPLICATION_CREDENTIALS and GOOGLE_CLOUD_PROJECT environment variables should be enough to get running. See https://cloud.google.com/docs/authentication/production#obtaining_credentials_on_app_engine_standard_environment (note the comment about this being uncommon).






share|improve this answer





















    Your Answer






    StackExchange.ifUsing("editor", function () {
    StackExchange.using("externalEditor", function () {
    StackExchange.using("snippets", function () {
    StackExchange.snippets.init();
    });
    });
    }, "code-snippets");

    StackExchange.ready(function() {
    var channelOptions = {
    tags: "".split(" "),
    id: "1"
    };
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function() {
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled) {
    StackExchange.using("snippets", function() {
    createEditor();
    });
    }
    else {
    createEditor();
    }
    });

    function createEditor() {
    StackExchange.prepareEditor({
    heartbeatType: 'answer',
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader: {
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    },
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    });


    }
    });














     

    draft saved


    draft discarded


















    StackExchange.ready(
    function () {
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53345640%2fis-there-a-way-calling-finddefaultcredentials-successfully-using-2nd-gen-local-a%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes








    up vote
    0
    down vote













    Set the GOOGLE_APPLICATION_CREDENTIALS environment variable before starting your application.



    With the second generation runtime, if you aren't using any google.golang.org/appengine APIs, you do not need to use dev_appserver.py -- you can build and start your application normally (go build and/or go run).



    Also, it's very uncommon to explicitly pass the credentials. cloud.google.com/go APIs should all automatically find your credentials for you. When you're running locally, setting the GOOGLE_APPLICATION_CREDENTIALS and GOOGLE_CLOUD_PROJECT environment variables should be enough to get running. See https://cloud.google.com/docs/authentication/production#obtaining_credentials_on_app_engine_standard_environment (note the comment about this being uncommon).






    share|improve this answer

























      up vote
      0
      down vote













      Set the GOOGLE_APPLICATION_CREDENTIALS environment variable before starting your application.



      With the second generation runtime, if you aren't using any google.golang.org/appengine APIs, you do not need to use dev_appserver.py -- you can build and start your application normally (go build and/or go run).



      Also, it's very uncommon to explicitly pass the credentials. cloud.google.com/go APIs should all automatically find your credentials for you. When you're running locally, setting the GOOGLE_APPLICATION_CREDENTIALS and GOOGLE_CLOUD_PROJECT environment variables should be enough to get running. See https://cloud.google.com/docs/authentication/production#obtaining_credentials_on_app_engine_standard_environment (note the comment about this being uncommon).






      share|improve this answer























        up vote
        0
        down vote










        up vote
        0
        down vote









        Set the GOOGLE_APPLICATION_CREDENTIALS environment variable before starting your application.



        With the second generation runtime, if you aren't using any google.golang.org/appengine APIs, you do not need to use dev_appserver.py -- you can build and start your application normally (go build and/or go run).



        Also, it's very uncommon to explicitly pass the credentials. cloud.google.com/go APIs should all automatically find your credentials for you. When you're running locally, setting the GOOGLE_APPLICATION_CREDENTIALS and GOOGLE_CLOUD_PROJECT environment variables should be enough to get running. See https://cloud.google.com/docs/authentication/production#obtaining_credentials_on_app_engine_standard_environment (note the comment about this being uncommon).






        share|improve this answer












        Set the GOOGLE_APPLICATION_CREDENTIALS environment variable before starting your application.



        With the second generation runtime, if you aren't using any google.golang.org/appengine APIs, you do not need to use dev_appserver.py -- you can build and start your application normally (go build and/or go run).



        Also, it's very uncommon to explicitly pass the credentials. cloud.google.com/go APIs should all automatically find your credentials for you. When you're running locally, setting the GOOGLE_APPLICATION_CREDENTIALS and GOOGLE_CLOUD_PROJECT environment variables should be enough to get running. See https://cloud.google.com/docs/authentication/production#obtaining_credentials_on_app_engine_standard_environment (note the comment about this being uncommon).







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered 12 hours ago









        Tyler Bui-Palsulich

        4968




        4968






























             

            draft saved


            draft discarded



















































             


            draft saved


            draft discarded














            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53345640%2fis-there-a-way-calling-finddefaultcredentials-successfully-using-2nd-gen-local-a%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            Paul Cézanne

            UIScrollView CustomStickyHeader Resize height generates problems when scroll is too fast

            Angular material date-picker (MatDatepicker) auto completes the date on focus out