Explore Azure Functions Flashcards
What are azure functions?
- serverless solution that allow you to write less code, maintain less infrastructure and save on costs
- No worries about managing infrastructure, azure provides all the up-to-date resources needed to keep apps running
What are the two kep components of azure functions?
- Triggers; provide a way to start execution of code
- Bindings; simplify coding for input and output data
- All functions must have one trigger but they do not have to have a binding
How are functions and logic apps different from one another? (Long answer)
- Functions are serverless compute service, logic apps are serverless workflow integration platform
- Functions use code to create orchestrations, logic apps use GUI/Config files
- Functions are code first (imperative), logic apps are designer-first (declarative)
- Each activity is an azure function that we write code for, logic apps has a collection of ready-made actions instead
- Functions use app insights, logic apps use monitor logs
What are orchestrations in terms of functions
- a collection of functions that are executed to complete a task
How are functions and webjobs similar?
- Both code first integration services designed for devs
- built on app service and support features such as source control integration, authentication and monitoring with app insights
- functions are built on top of webjobs SDK, sharing many of the same triggers and connections
How are functions and webjobs different?
- Only functions provide automatic scaling, development and testing browser, pay-per-use pricing and integration with logic apps
- Webjob triggers include Timer, queues, blobs, service bus queues and topics, cosmos DB, event hubs and file system
- Function triggers include all of those plus HTTP/WebHook and azure event grid
- functions offer more dev productivity and offer more options for programming languages, dev environments, azure service integration and pricing
What hosting plans are availble for functions?
- consumption
- premium
- app service/dedicated
- all available on windows and linux
What does the function hosting plan dictate?
- how your function app is scaled
- the resources available to each function app instance
- support for advanced functionality such as vnet connectivity
What are the benefits of the consumption function hosting plan?
- default hosting plan that scales automatically and you only pay for compute resources when your functions are running
- Instances of the functions host are dynamically added and removed based on the number of incoming events
- Timeout default duration is 5 mins with max of 10
What are the benefits of the premium function hosting plan?
- auto scales based on demand using pre-warmed workers which run apps with no delay after being idle
- runs on more powerful instances and connections to vnets
- timeout default duration is 30 mins with unlimited max
What are the benefits of the dedicated function hosting plan?
- run your functions with an app service plan at regular app service plan rates
- best for long-running scenarios where durable functions cant be used
- timeout default duration is 30 mins with unlimited max
What are the two other hosting options for functions?
- App Service Environment (ASE); app service feature that provides a fully isolated and dedicated env for securely running app service apps at high scale
- Kubernetes; provides a fully isolated and dedicated env running on top of the kubernetes platform
- both provide the highest level of control and isolation in which to run your functions apps
How does scaling work on the consumption function hosting plan?
- event driven, scale out automatically even during periods of high load
- adds more instances of the functions host based on the number of incoming trigger events
- max instances are 200 on windows and 100 on linux per function app
How does scaling work on the premium function hosting plan?
- event driven and identitcal to function app
- max instances are 100 on windows and 20-100 on linux
How does scaling work on the dedicated function hosting plan?
- manual/autoscale
- 10-20 max instances