What is Azure Function
Azure Functions is a serverless solution that allows you to write less code, maintain less infrastructure, and save on costs. Instead of worrying about deploying and maintaining servers, the cloud infrastructure provides all the up-to-date resources needed to keep your applications running.
What is Trigger and Binding in azure ?
Triggers are what cause a function to run. A trigger defines how a function is invoked and a function must have exactly one trigger. Triggers have associated data, which is often provided as the payload of the function.
Binding to a function is a way of declaratively connecting another resource to the function; bindings may be connected as input bindings, output bindings, or both. Data from bindings is provided to the function as parameters.
You can mix and match different bindings to suit your needs. Bindings are optional and a function might have one or multiple input and/or output bindings.
Triggers and bindings let you avoid hardcoding access to other services. Your function receives data (for example, the content of a queue message) in function parameters. You send data (for example, to create a queue message) by using the return value of the function.
Example- A scheduled job reads Blob Storage contents and creates a new Cosmos DB document.
Trigger = Timer
Input binding = Blob Storage
Output binding = Cosmos DB
Sample Function
What is Cold Start ?
Cold start is a term used to describe the phenomenon that applications which haven’t been used take longer to start up.
What is Durable Function
Durable Functions is an extension of Azure Functions and Azure WebJobs that lets you write stateful functions in a serverless environment. The extension manages state, checkpoints, and restarts for you.
Run Azure Function Locally
- Install the Core Tools and dependencies.
- Download the VS Code Extension - Azure Functions
- Download Postman
- In the terminal run the command- dotnet restore
- Initialize and run the code in VS Studio with the extension
- Test the code from Postman
No comments:
Post a Comment