functions-recipes | Functions Recipes is a library of examples to help | Runtime Evironment library
kandi X-RAY | functions-recipes Summary
kandi X-RAY | functions-recipes Summary
Salesforce Functions lets you use the Salesforce Platform for building event-driven, elastically scalable apps and experiences. Salesforce Functions is designed to boost developer productivity by reducing your infrastructure responsibilities and enabling you to build and integrate Functions-as-a-Service (FaaS) apps using the languages and tools of your choice. Functions Recipes is a library of examples to help you getting started with Salesforce Functions and get used to their main features. To learn more about Salesforce Functions please visit the documentation center.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of functions-recipes
functions-recipes Key Features
functions-recipes Examples and Code Snippets
Community Discussions
Trending Discussions on functions-recipes
QUESTION
I've got an Azure Function defined that uses an Azure Storage Queue Trigger and Blob input bindings. I've got a POCO for the queue trigger but how can I use that POCO with a binding expression in the blob input binding?
Architecuture:
- Azure Functions 2.x
- Precompiled C# library (.NET Core 2.1)
POCO:
...ANSWER
Answered 2019-Oct-04 at 15:02use the following in the Blob binding:
QUESTION
I know how to bind queries directly to an Azure Function and use Cosmos DB triggers in functions.
However, I'm looking for direction around using DocumentClient
(Nuget package Microsoft.Azure.Cosmos
) directly.
- There's documentation that explains how to reuse a static client instance between executions.
- It is also possible to get a
DocumentClient
instance as a binding by adding[DocumentDB("test", "test", ConnectionStringSetting = "CosmosDB")] DocumentClient client
to the function's parameters. - Finally, it is possible to create a
DocumentClient
instance in the function's body:var client = new DocumentClient(...)
.
I do not find a clear recommendation when to use what approach except that number 3 never is a good option because of performance, memory usage and connection limits. Also, I understand that using a static instance has advantages.
Questions
- Azure functions have a connection limit (discussed here). Does this also apply when using approach 2 (bind to client)?
- What are the pros and cons of using approach 2 (binding) versus 1 (static)?
- What's the advantage of binding to a SQL query compared to binding to a
DocumentClient
and creating the query in the function's body?
ANSWER
Answered 2019-May-24 at 08:20This article makes a good case for a static client.
We all know the woes of this approach for the HttpClient (and if you don’t, please read it right after this article!), and it has the exact same effect here: If the Function is getting a high volume of triggers, we not only will be penalizing the performance of our database calls with the initialization overhead but the memory consumption will raise and we might even incur in socket exhaustion scenarios.
To your questions 2 and 3: The big pro of using the binding is simplicity. All the creation of the clients etc is abstracted away from you. Con of this is of course control. Here is a good example of using a custom client.
Using the SQL query instead of the DocumentClient is one step further up in regards to abstraction.
QUESTION
I want to use output queue in my azure function. I get an example code from: https://docs.microsoft.com/en-us/sandbox/functions-recipes/queue-storage
...ANSWER
Answered 2019-Jan-28 at 00:08You are looking for IAsyncCollector
to change from out param to that. Instead of “out string message” you change to ICollector messages
or IAsyncCollector
and add you message to the collection in the body.
QUESTION
With recent changes to the Azure Function App version 2 in Sept 2018, my function app code was refactored. However, it seems that:
- LogTrace() messages no longer show in the console window (and I suspect Application Insights), and
- categoryLevels in host.json does not seem to be respected.
The issue was duplicated in a sample application below in the call to LogWithILogger(). Two other points:
(1) I note that the default filter trace level seems to be hard-coded. Could another Filter be added to allow LogTrace() to work, or should LogTrace() no longer be used? If another Filter can be added, how does one inject the necessary objects into the Function App to permit that?
...ANSWER
Answered 2018-Oct-08 at 10:22For v2 function, log setting in host.json
has a different format.
QUESTION
I'm trying to create a configured object that can be reused along requests in Azure Functions. The example below is in C#. The idea is to avoid the expensive creation of a customized DocumentClient
instance for each request. The client
field is static and is reused in this example taken from the documentation:
ANSWER
Answered 2018-Jul-02 at 12:05You've already achieved your goal. let
binding in F# module will only be executed once per Azure Functions instance, it's similar to static read-only field in C#.
Azure Functions can run multiple instances (servers) at the same time and over time. Each time a new instance is provisioned, the first execution will be slow and will include your initialization of expensive expressions. The next execution on the same instance will reuse them though, so it will be much faster.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install functions-recipes
For more information about how to configure your organization for Salesforce Functions, please refer to the documentation.
If you haven't already done so, authorize with your org and provide it with an alias (fnrecipesorg in the command below):
Clone the functions-recipes repository:
Create a scratch org and provide it with an alias (functions_recipes in the command below):
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page