Azure Functions Flashcards

(35 cards)

1
Q

What is serverless and what are serverless service charateristics?

A
  • 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
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is Function as a Service and FaaS characteristics?

A
  • 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
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What are Azure Functions and their properties?

A
  • 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
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What is a Function App?

A
  • 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
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What are the storage considerations for Azure Function - Function Apps?

A
  • 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
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What core files can be found in an Azure Function?

A
  • 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
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What are Azure Function authorization levels and features of the different Azure Function authorization levels?

A
  • 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 well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

How can you debug Azure Functions?

A
  • Enable streaming logs for Azure Functions to see near real time logging when an error occurs
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

How do you view a stream of log files being generated by Azure Functions?

A
  • Azure Monitor
  • Built-in log streaming - Via App Service platform
  • Live Metrics Stream - In Azure Portal when connected to Application Insights
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Why are Azure Functions fast to execute?

A
  • No large application, startup time, initialisation, and other events fired before code is executed
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What are the infrastructure and maintenance costs of Azure Functions?

A
  • No infrastructure and maintenance costs
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

How are Azure functions executed?

A
  • Event-Driven
  • Execution is triggered when an event is fired and can emit event data
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

How do Azure functions communicate?

A
  • Using industry standard protocols with other APIs, databases, and libraries
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

How much do Azure Functions cost?

A
  • 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 well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

How is CI/CD handled for Azure Functions?

A
  • Built in CI/CD via Azure DevOps
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

What are example Business Azure Function Use-Cases?

A
  • Scheduled Tasks
  • Reminders and Notifications
  • Lightweight Web API
  • Sending background emails
  • Running background backup tasks
  • Doing backend calculations
17
Q

What are example Techincal Azure Function Use-Cases?

A
  • Sending emails
  • Starting backup
  • Order processing
  • Task scheduling (database cleanup, sending notifications, messages, IoT data processing)
18
Q

What type of of apps are Azure Functions best suited for?

A
  • Smaller apps that have events that can work independently of other websites
19
Q

What are output bindings?

A
  • One or more data sinks that will receive outputted data from a function on successful execution
20
Q

Requirements for working with Azure Functions (VSCode)

A
  • Install Azure Functions extension
  • Use Azure icon in the Activity Bar with a Side Bar drawer called Functions
21
Q

What is an Application Runtime?

A
  • An application runtime, is compute environment configured with the necessary software and system configuration to run a specific type of application code.
22
Q

What hosting options do Azure Function Apps have?

A
  • Windows
  • Linux
23
Q

What function templates does Azure provide and what triggers them?

A
  • 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
24
Q

What are the 3 types of Azure Function Plans?

A
  • Consumption Plan (Serverless) - Cold Starts
  • Premium Plan (Functions Premium) - Pre-Warmed
  • Dedicated Plan (App Service Plan) - VM Sharing, optimal when you have underutilized VMs
25
What is a trigger?
* Causes function to **run** * Defines how function is **invoked** * Function must have **one** trigger * Can have associated data provided as the payload of the function * Direction property in the function.json file is always **In**
26
What is a binding?
* Define if your function is **connected** to another service * Functions can have multiple input and output bindings * Direction property in the function.json file can be **In**, **Out**, or **Inout** * Can use **binding expressions** that resolve to values from various sources
27
6 Types of Binding Expressions
* App Settings * Trigger filename * Trigger metadata * JSON Payloads * New GUID * Current Date and Time
28
Local Settings File name and contents?
* local.settings.json * IsEncrypted - encrypt with local machine key * Values - Application settings * Host - Functions host process * ConnectionStrings
29
What do Azure Functions Core Tools let you do?
* Develop and test your functions on your local computer
30
Azure Functions Core Tools **Top-Level Commands** and Azure Functions Core Tools **Command Groups**
* func **init** * func **logs** * func **new** * func **run** * func **start** * func **azure** * func **durable** * func **extensions** * func **kubernetes** * func **settings** * func **templates**
31
What are Azure Functions Custom Handlers and their requirements?
* Lightweight web servers that receive events from the Functions host * Must be written in a language that supports **HTTP primitives** * Used for language not supported by an existing Azure runtime - Go, Rust or Ruby etc. or runtime environment configured for specific technology - Ruby on Rails etc. * Triggers, input and output bindings are used via **extension bundles** * Must have a **host.json** file, a **local.settings.json** file, a **function.json** file for each function (inside folder matching the function name), a **command, script, or executable** which runs a web server | /MyQueueFunction | function.json | host.json | local.settings.json | handler.exe
32
What Application runtimes does Azure support?
* .NET * Java * Node.js * PowerShell Core * Python
33
Reasons an Azure Function is unreachable?
* Storage account was deleted * Storage account app settings deleted * Storage account credentials invalid * Storage account inaccessible * Daily execution quota is full * App behind firewall
34
What are Durable Functions, what two types of functions does it introduce, what languages are supported, and requirements to use?
* **Serverless compute extension** of Azure Functions **that allows you to write stateful functions** * Orchestrator function - define stateful workflows * Entity function - manage the state of an entity * They define **workflows** in code, no JSON schemas or designers needed * They call other functions **synchronously** and **asynchronously** * They **automatically checkpoint** their progress whenever the function awaits * C#, JavaScript, Python, F#, PowerShell, PowerShell 7 * Must install a library specific to your language (npm install durable-functions)
35
Patterns of Durable Functions
* Function chaining * Fan-out/fan-in - execute multiple functions in parallel then wait for them all to finish * Fan out - functions sends multiple messages to a queue * Fan in - Track when the queue-triggered functions end and store the outputs. * Async HTTP API - have an HTTP call trigger the long-running action, then redirect the client to a status **endpoint** that they can **poll** to learn when the operation is complete * Monitor pattern - flexible recurring process e.g. polling until certain conditions are met * Human Interaction - using timeouts and compensation logic * Aggregator (stateful entities) - group event data into a single entity