Learning-204 Flashcards
What is Serverless?
A serverless service could have all or most of the following characteristics:
- Highly elastic and scalable
- highly available
- Highly durable
- Secure by default
What is Function as a Service (FaaS)?
Allows developers to focus on just writing pieces of code (functions)
Has event-driven integration trigger functions based on event data or to emit event data
Generally multiple functions are orchestrated together to create a serverless app
Functions generally only run when needed.
Function as a Service (FaaS) is not serverless on its own.
FaaS is only serverless if it’s fully managed and scales to zero ( when not in use the serverless resources cost nothing).
What is Cloud Instance Initialization?
The process of preparing an instance with configuration data for the operating system and runtime environment.
Cloud instances are initialized from a disk image and instance data:
Meta-data
User-data
Vendor-data
Azure VMs are grouped into:
Types
- General purpose: Balanced CPU-to-Memory ratio. Testing and development, small to medium databases, and low to medium traffic web servers.
- Compute optimized: High CPU-to-memory ratio. Good for medium traffic web servers, network appliances, batch processes, and app servers.
- Memory optimized: High memory-to-CPU ratio. Great for relational database servers, medium to large caches, and in-memory analytics
- Storage optimized: High disk throughput and IO ideal for Big Data, SQL, NoSQL databases, data warehousing and large transactional databases.
- GPU accelerated: Specialized VMs for heavy graphic rendering and video editing, model training and inferencing (ND) with deep learning. Available with single or multiple GPUs.
- FPGA (field-programmable gate array) accelerated: specialized virtual machines available with single or multiple FPGAs. Machine learning inference, Video transcoding, Database search and analytics
-High performance compute: Our fastest and most powerful CPU virtual machines with optional high-throughput network interfaces
Azure Functions uses 4 storage types in the Storage Account
- Blob Storage: Maintain bindings state and function keys
- Azure Files:
=>File share is used to store and run your function app code in a Consumption Plan and Premium Plan.
=>Azure Files is set up by default, but you can create an app without Azure Files under certain conditions. - Queue Storage:Used by task hubs in Durable Functions and for failure and retry handling by specific Azure Functions triggers.
- Table Storage: Used by task hubs in Durable Functions.
Azure Functions
function.json — configuration of a single function defining the function’s trigger, bindings, and other configuration settings.
Code — The 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
The authorization level can be one of 3 values
anonymous—No API key is required.
function—A function-specific API key is required (default value).
admin—The master key is required.
here are two ways to view a stream of log files being generated by your function executions
- Built-in log streaming
the App Service platform lets you view a stream of your application log files. - Live Metrics Stream
when your function app is connected to Application Insights, you can view log data and other metrics in near real-time in the Azure portal using Live Metrics Stream
Azure provides function templates to get you started with common function scenarios
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 triggered by event from Event Grid
Many Azure services can trigger a function through Event Grid
Event Grid is a serverless event bus integrated with Azure services
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
You choose the function template during project creation only in Visual Studio Code
What is a trigger?
A trigger is a specific type of event which causes the function to run.
It defines how a function is invoked and a function must only have one trigger.
Triggers can have associated data which is often provided as the payload of the function.
The direction of triggers is always In
What is a binding?
Bindings define if your function is connected to another service
The data from bindings is provided to the function as parameters.
Bindings are optional, and a function can have multiple input and output bindings
Azure Functions – Unreachable, what reasons?
Storage account was deleted
Storage account application settings were deleted
Storage account credentials are invalid
Storage account is inaccessible
Daily execution quota is full
App is behind a firewall
Durable Functions
Durable Functions is a serverless compute extension of Azure Functions that allows you to write stateful functions.
The extension introduces two types of functions:
Orchestrator 调者 function — define stateful workflows (implicitly representing state via control flow.)
Entity function — manage the state of an entity (explicitly representing state)
KEDA
AKS
Kubernetes Event-driven Autoscaling (KEDA) allows you to setup autoscaling based on events from various cloud-native and third-party services.
Azure Kubernetes Services (AKS)
What is Cloud Instance Initialization?
The process of preparing an instance with configuration data for the operating system and runtime environment.
Cloud instances are initialized from a disk image and instance data:
Meta-data
User-data: is a script that you want to run when an instance first boots up
Vendor-data