Azure Functions Overview
prem murmu
on
9/16/2020 3:08:30 PM
When we say serverless computing,right thing will be the Azure Functions. It is a modern serverless architecture delivering event driven cloud computing.
In Azure function we can run small pieces of code (called "functions") without worrying about application infrastructure. Or Azure Function is a serverless compute service that enables user to run event-triggered code without having to provision or manage infrastructure.
With Azure Functions, the cloud infrastructure provides all the up-to-date servers It can even be scaled according to demand. To build the apps themselves, the developers can use their own choice of programming language, giving them the freedom to work optimally.
A function is "triggered" by a specific type of event. Supported triggers include responding to changes in data, responding to messages, running on a schedule, or as the result of an HTTP request.
Azure function code Example.
// This is HTTP Trigger function,Lets try to understand code
#r "Newtonsoft.Json" // to reference external assembly ,Use #r
using System.Net;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Primitives;
using Newtonsoft.Json;
// HttpRequest object will contain methods(get,post ),Header and body informations
//ILogger is to log to activity in function
public static async Task<IActionResult> Run(HttpRequest req, ILogger log)
{
log.LogInformation("C# HTTP trigger function processed a request.");
//fecthing the request querystring parameter
string name = req.Query["name"];
//Below three line to read the requestbody
//ReadToEndAsync read all data from the requestbody
string requestBody = await new StreamReader(req.Body).ReadToEndAsync();
//DeserializeObject to get the Json object
dynamic data = JsonConvert.DeserializeObject(requestBody);
//Get the name from data object
name = name ?? data?.name;
string responseMessage = string.IsNullOrEmpty(name) ? "This HTTP triggered function executed successfully. Pass a name in the query string or in the request body for a personalized response." : $"Hello, {name}. This HTTP triggered function executed successfully.";
//Return http result
return new OkObjectResult(responseMessage);
}
Key features of Azure Functions:
HTTP:
Timer:
Azure Cosmos DB:
Blob storage:
Queue storage:
Event Grid:
Event Hub:
Service Bus Queue:
Service Bus Topic:
Azure Functions pricing plans:
Consumption plan:
Premium plan:
App Service plan:
0 Comments on this post
Comments(0)||Login to Comments
- see more..
Categories
ALLAsp.Net (3)
Sitecore (11)
Issues Resolved (9)
Sitecore 9.3 (2)
International Business (1)
Innovations in Industries (3)
Supply Chain Management (1)
Industrial Engineering (14)
Sitecore 10 (4)
Sharepoint (1)
Azure (4)
Cloud Computing (1)
Online Courses (1)
Online Resources (2)
C# (1)
Blazor WebAssembly (2)
Sitecore form (1)
MS Sql Server (1)
Angular 11 (2)
Automobile Engineering (5)
Sitecore powershell (1)
Devops (2)
Microservice Architecture (1)
Sitecore Interview Questions (2)
Dotnet interview questions (1)
Sitecore useful links (1)
Privacy&Cookies (2)
Solr Search (2)
JavaScript (1)
sitecore xm cloud (3)