Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Azure Functions Internals

Azure Functions Internals

Andrea Ceroni

February 07, 2019
Tweet

More Decks by Andrea Ceroni

Other Decks in Programming

Transcript

  1. Functions as a Service (FaaS) A platformfor running"functions", wichare simply

    yourcoderunningin responseto an event code + event + data Azure Fucntions =
  2. 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...
  3. 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
  4. 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
  5. 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
  6. 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
  7. [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; }