Azure Functions Flashcards
(35 cards)
What is serverless and what are serverless service charateristics?
- Fully managed cloud services
- Abstracts away underlying infrastructure
- Billed based on the execution of your business task
- Can scale-to-zero meaning when not in use the serverless resources cost nothing
- Highly elastic and scalable
- Highly available
- Highly durable
- Secure by default
What is Function as a Service and FaaS characteristics?
- Category of cloud computing service that allows developers to focus on just writing pieces of code (functions) and not worry about maintaining the underlying computing infrastructure
- Event-driven integration trigger functions based on event data or to emit event data
- Generally multiple functions can be orchestrated together to create a serverless app
- Generally only run when needed
- Is not serverless on its own - FaaS is only serverless if its fully-managed and scales to zero
What are Azure Functions and their properties?
- FaaS offering that allows developers to focus on just writing pieces of code (functions) and not worry about maintaining the underlying computing infrastructure
- Lightweight and can be serverless
- Easier to write and deploy
What is a Function App?
- Function App defines the underlying configuration for a collection of functions such as Hosting, Runtime and other global configurations and the compute for a collection of functions.
- Requires a storage account to operate
What are the storage considerations for Azure Function - Function Apps?
- Storage Account
- Blob Storage - maintain bindings state and function keys
- Azure Files - File share used to store and run your function app code in a Consumption Plan and Premium Plan. Set up by default, can create an app without Azure Files under certain conditions
- Queue Storage - used by task hubs in Durable Functions
- Table Storage - used by task hubs in Durable Functions
What core files can be found in an Azure Function?
- function.json - configuration of a single functions bindings
- index.js / Code - code for your function
- .funcignore - files to ignore
- host.json - global configuration of all functions at the function app level
- Local Project - a place to locally store code
What are Azure Function authorization levels and features of the different Azure Function authorization levels?
- Determines what keys, if any, need to be present on the request in order to invoke the function
- Anonymous - No API key required
- Function - Function-specific API key is required
- Admin - Master API key is required
- Can be changed after creation in the portal
- Set on the trigger of the function
How can you debug Azure Functions?
- Enable streaming logs for Azure Functions to see near real time logging when an error occurs
How do you view a stream of log files being generated by Azure Functions?
- Azure Monitor
- Built-in log streaming - Via App Service platform
- Live Metrics Stream - In Azure Portal when connected to Application Insights
Why are Azure Functions fast to execute?
- No large application, startup time, initialisation, and other events fired before code is executed
What are the infrastructure and maintenance costs of Azure Functions?
- No infrastructure and maintenance costs
How are Azure functions executed?
- Event-Driven
- Execution is triggered when an event is fired and can emit event data
How do Azure functions communicate?
- Using industry standard protocols with other APIs, databases, and libraries
How much do Azure Functions cost?
- Pay while your functions are running
- Automatically scale to meet the demand of traffic - underneath Azure will provision more serverless containers
- Can Scale-to-Zero cost
How is CI/CD handled for Azure Functions?
- Built in CI/CD via Azure DevOps
What are example Business Azure Function Use-Cases?
- Scheduled Tasks
- Reminders and Notifications
- Lightweight Web API
- Sending background emails
- Running background backup tasks
- Doing backend calculations
What are example Techincal Azure Function Use-Cases?
- Sending emails
- Starting backup
- Order processing
- Task scheduling (database cleanup, sending notifications, messages, IoT data processing)
What type of of apps are Azure Functions best suited for?
- Smaller apps that have events that can work independently of other websites
What are output bindings?
- One or more data sinks that will receive outputted data from a function on successful execution
Requirements for working with Azure Functions (VSCode)
- Install Azure Functions extension
- Use Azure icon in the Activity Bar with a Side Bar drawer called Functions
What is an Application Runtime?
- An application runtime, is compute environment configured with the necessary software and system configuration to run a specific type of application code.
What hosting options do Azure Function Apps have?
- Windows
- Linux
What function templates does Azure provide and what triggers them?
- HTTP - triggered by an HTTP request and returns HTTP
- Timer - triggered based on a schedule
- Blob Storage - triggered when files are uploaded/updated in a Blob storage container.
- Cosmos DB - triggered when processing a new/modified Cosmos DB documents.
- Queue Storage - triggered by Azure Storage queue messages.
- Event Grid (serverless event bus integrated with Azure services that mane Azure services can use to trigger a function) - triggered by event from Event Grid
- Event Hub – triggered by Event Hub event. (streaming)
- Service Bus Queue – triggered by a message in a Bus Queue (messaging)
- Service Bus Topics – triggered by an event from Bus Topic (pub/sub)
- SendGrid — triggered by an email event in third-party service SendGrid
What are the 3 types of Azure Function Plans?
- Consumption Plan (Serverless) - Cold Starts
- Premium Plan (Functions Premium) - Pre-Warmed
- Dedicated Plan (App Service Plan) - VM Sharing, optimal when you have underutilized VMs