Share
Embed
Azure Functions Internals
Andrea Ceroni
February 07, 2019
Transcript
18 slides
-
Azure Functions Internals Andrea Ceroni [email protected] @andrekiba6 Sponsored by 7
febbraio 2019 Relatore -
Functions as a Service (FaaS) A platformfor running"functions", wichare simply
yourcoderunningin responseto an event code + event + data Azure Fucntions = -
Trigger Timer: run a function on a schedule Message: listen
for messages on a queue HTTP Request: implement web APIs or webhooks Blob Storage: Azure Storage blob creation Many more: Cosmos DB, Azure Service Bus, Event Grid... -
Hosting Models Consumption Plan (Serverless) Per-second billing 1.000.000 executions 400.000
GBs App Service Plan Reserved servers Predictable monthly cost Docker Container Run anywhere On premises Other cloud providers -
Dev Environments Azure Portal https://portal.azure.com Experiments Proof of concept Visual
Studio 2017 Powerful IDE Azure Functions extensions Debug and test locally Azure Functions Core Tools Cross platform Visual Studio Code Azure Functions extensions -
Other Features Security API keys Identity provider integration Durable Functions
Define workflows Run task in parallel Retries and error handling Proxies Route incoming requests Static website Transform requests and responses -
Deploy Function App Manual Deploy Visual Studio or VS Code
Create a new Function App Publish to an existing Function App Git Automated deployment Configure in portal GitHub or Azure DevOps Zip Kudu API Azure Functions Core Tools Azure CLI -
[FunctionName("Question")] public static async Task<IActionResult> AskQuestion( [HttpTrigger(AuthorizationLevel.Anonymous, "post", Route="question")] HttpRequest
req, ILogger log) { var body = await new StreamReader(req.Body).ReadToEndAsync(); var question = JsonConvert.DeserializeObject<Question>(body); if(iKnowTheAnswer J) return new OkObjectResult(Answer()); return new NotFoundResult() L; }