Serverless Applications Flashcards
Benefits of Azure Functions
- Use preferred language
- Automate deployments
- Troubleshoot issues with monitoring and testing tools
- Flexible pricing options (Consumption and App Plans)
- Additional => Integration with Application Insights
- No infrasture to manage
- Auto Scaling
What are Azure Functions?
- Is a cloud-based compute service. Functions provide event-driven and scalable serverless for Azure. In some cases, you only get billed for the time your function runs
- Can respond to events or time-based
Examples of trigger types
- HTTP
- Storage events
- Events (Event hub etc)
- Queue messages
What are bindings?
- Allow you to bind data to your app function or send data to.
What are the two binding types?
Input
Output
Features of Azure Functions
- Flexible Pricing Plans
- Scalability
- Event based architecture
Contrast the pricing options in Azure Functions
Consumption
* True serverless option
* Auto scaling
Premium
* Good for functions that are long running
* Functions are kept initialized
* Can scale faster
* Best for underutilized App Service Plans
Dedicated
* Scale based on load and will scale down automatically
All functions in a Function App share the same resources and connections?
True
Identity the Key Components of Azure Functions
- Function Triggers
- Function Bindings
- Function Runtime
- API Management
- Deployment Slots
- Function App Configurations
Briefly explain Function Triggers?
- Only one trigger per Function App
- Triggers start the Function App to execute
- Triggers define HOW and Function App is invoked
Briefly explain Function Bindings
Allow data to be bound to the App Functions for both inputs and outputs. Input bindings can be access via parameters to the function call.
You can also use client libraries to access data if you don’t want to use bindings.
You can have 0, 1, or more bindings.
Briefly explain Function Runtimes
Azure Functions allow for various programming languages to implement your function. Besides C#, there is Node.js, JAVA, and Python.
Briefly explain API Management in Azure Functions
AIPM Managment service provides security and routing to your App Functions’ API as a way to expose them as TRUE REST endpoints.
Briefly explain Deployment Slots in Azure Functions
Deployment slots are additional instances with it’s own endpoint that can be used to test new versions of your function app and can easily be swap to production
Briefly explain App Function Configurations
Each function app will have it’s own configuration parameters such as connection strings as well as any variables that can be accessed by environment variables.
Best examples of uses with App Functions?
Options for running Work Flows in Azure?
- Web Jobs
- App Functions
- Logic Apps
- Power Automate
Allow the above share similar functionaltiy as far as accept inputs, handle outputs, invoked by an event, and include conditions
What is the Design First Approach?
Users can use Logic Apps or Power Automate which offers a low code/no code option.
Logic Apps provide an UI to design the business workflows and offers over 200 connectors
Power Automate is similar and can integrate with many difference components as well using connectors. It is a service to create workflows even if you don’t have development experience.
What are the 4 types of flows in Power Automate?
- Automated => triggered by an even
- Button => runs a repeatitive task with a single click
- Scheduled => Runs on a set schedule
- Business Process => Models a business process such as an ordering process or complaint
See comparisons below
What services use the Code-First Technologies?
Web Jobs
Function Apps
What 2 types of Web Jobs are there?
- Continuous
- Triggered
What are the differences between Web Jobs vs Azure Functions
* Supported Languages
* Auto Scaling
* Development in browser
* Pay-per-use pricing
* Integration with Logic Apps
* Package Managers
* Can be part of an App Service Plan
- Languages => C# | C#, Java, JavaScript, PowerShell, etc
- Auto Scaling => No | Yes
- Test in browser => No | Yes
- Pay-per-use => No | Yes
- w/ Logic Apps => No | Yes
- Pack. Mgrs => Nuget | Nuget and NPM
- Part of App Plan => Yes | Yes (hosted under an App Service Plan)
What are 2 drawbacks of Serverless Computing?
Execution Time
* By default, time out is 5 minutes, but can go to 10 minutes
* For HTTP request, the timeout is restricted to 2.5 minutes
* Durable Functions can be used to bypass tese timeout restrictions
Execution Frequency
* If an app function is going to execute continously, it might be cheaper hosing on VM
* Only one Function App can be create every 10 seconds up to a total of 200
(keep in find mind each instance can service multiple concurrent execute so theres no limit how much traffice a single instance can handle)
True or False - A Function App must be linked to a Storage Account
True
On Consumption Plans, the Storage Account is where the code and configuration are stored
Name at least 6 trigger types
- Blob Storage
- Cosmos DB
- Event Grid
- Service Bus
- Timer
- Http
- Graph Events
- Queue Storage
Advantage of using Bindings
Do not have to write connection code and manage connections
What are some of the properties in the configuration file
- name (the name of the parameter in the function)
- type
- direction
- queueName, path if blob, methods if HTTP { get, post }
- connection
What is the header name when using a function key to secure the HTTPS request
x-functions-key
What are the authorization levels for Function Apps?
- Function (default)
- Admin (use master global key)
- Anonymous
What is the CRON expression “sections” in order?
seconds, minutes, hour, day, month, day of week
Name at least 8 output bindings
- Blob Storage
- Azure Cosmos DB
- Event Hubs
- HTTP
- Microsoft GRAPH
- Mobile Apps
- Notification Hubs
- Queue Storage
- Send Grid
- Service Bus
- Table Storage
- Twillo
What are binding in parameters for Cosmos DB
- Document parameter name
- Database name
- Collection name
- Document ID
- Parition Key
- SQL Query (optional)
What are the binding out parameters for Cosmos DB
- Document Parameter name
- Database name
- Collection name
- Partition key
Compare Azure Durable Functions vs. Logic Apps (5 comparisons)
Development
* Code first Durable Functions
* Design first Logic Apps
Connectivity
* About a dozen built-in bindings but can create your own
* Large collection of connectors
Actions
* Each activity is an Azure Function
* Large collection of read-only make actions (can integrat custom logic through custom connectors)
Monitoring
* Application Insights
* Azure Portal and Azure Monitoring Logs
Management
* REST, API, PowerShell and Visual Studio
* Azure Portal, REST API, PowerShell, Visual Studio Code
What should you use in Durable Functions for timeouts and where should “it” be implemented?
Durable Timers and should be in the orchestrator function
Use this instead of setTimeout() or setInterval() (JavaScript)
Az CLI command for Storage Account
az functionapp create
–resource-group
–name
–storage-account
–runtime
–consumption-plan-location
–functions-version
Using the Az Core Tools and creating a function app locally, what is the Az CLI Command to publish?
az functionapp deployment source config-zip
–resource-group
–name
–src