question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

How is the CloudFunctionsService intended to be use used?

See original GitHub issue

Thanks for stopping by to ask us a question! Please make sure to include:

  • What you’re trying to do

I am trying to call a private cloud function using a service account credential file

  • What code you’ve already tried
            GoogleCredential credential;
            using (var stream = new FileStream("sa.json"), FileMode.Open, FileAccess.Read))
            {
                credential = GoogleCredential.FromStream(stream).CreateScoped();
            }

            var service = new CloudFunctionsService(new BaseClientService.Initializer
            {
                ApplicationName = "testing",
                HttpClientInitializer = credential
            });
  • Any error messages you’re getting

I receive no error messages. This cloud function service doesn’t have any public methods to execute a function with credentials. The documentation is not very good and I could use a little help understanding how we are intended to use the cloud function service type.

Thanks in advance.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:7

github_iconTop GitHub Comments

1reaction
jskeetcommented, Jan 11, 2022

Why do the docs for CallFunction call out that it should only be used for testing?

That’s a question for the product team, I’m afraid. It’s not something I know the details of. See this page for details of authenticating when calling the function from regular code. You might want to look at the Functions support page for options in terms of asking product questions, such as joining the Slack channel.

I’ll close this issue now as I believe the library-specific aspect of the issue is now covered.

0reactions
jskeetcommented, Jan 11, 2022

The part I’d like to use the library for is getting the id token from the service account credentials and sending that as the authz header.

You can do that with Google.Apis.Auth without using any Functions-specific library. I haven’t done it for Functions myself, but I’m sure we can sort out an example for you if you get stuck.

The api surface is very limited compared to what is available via cloud functions.

I’m afraid I don’t know what you mean by that.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Cloud Functions
Compute instances for batch jobs and fault-tolerant workloads. ... Fully managed service for scheduling batch jobs. ... Dedicated hardware for compliance, licensing ...
Read more >
Access control with IAM | Cloud Functions Documentation
Manage subscriptions in the user's project. Manage topics in the user's project.
Read more >
Google Cloud Functions monitoring integration
Google Cloud Functions service allows running code in a serverless way. Using the Google UI , developers can create short pieces of code...
Read more >
Extending Web Applications with Cloud Functions
This blog post intends to explore the use of cloud functions as extensibility mechanism for existing applications.
Read more >
Google Cloud Function fail to build
I am using the google cloud console to deploy the python function and not cloud shell. I even tried to make a new...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found