Implement Azure Functions Flashcards

1
Q

Should you consider Azure Functions for tasks that you want to run on a schedule?

A

Yes

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What starts the execution of code in a Function?

A

A trigger

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What simplifies coding for input and output data?

A

Bindings

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What other Azure services enables serverless workflows?

A

Azure Logic Apps

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What is the conceptual different between Functions and Logic Apps?

A

Functions is a serverless compute service; Logic Apps provide serverless workflows

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What is an orchestration?

A

A collection of functions or steps (called Actions in Logic Apps) that are executed to accomplish a complex task

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

How do you develop orchestrations in Functions?

A

By writing code and using the Durable Functions extension?

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

How do you develop orchestrations in Logic Apps?

A

By using a GUI and editing configuration files

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Can you mix and match Functions and Logic Apps to build an orchestration?

A

Yes. You can call functions from Logic Apps and Logic Apps from functions.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What do you use to monitor Azure Functions?

A

Application Insights

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What do you use to monitor Logic Apps?

A

Azure Portal and Azure Monitor Logs

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Do Functions support a serverless app model with auto-scaling?

A

Yes

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Do WebJobs support a serverless app model with auto-scaling?

A

No

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Can you integrate WebJobs with Logic Apps?

A

No

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

What additional trigger events do Functions have compared to WebJobs?

A

HTTP / Web Hook, Azure Event Grid

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

What are the three hosting plans for Function apps?

A

Consumption, Functions Premium, and App Service (Dedicated)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

What does the hosting plan dictate for Functions?

A
  • How the function app is scaled
  • The resources available to each function app instance
  • Support for advanced functionality, like Virtual Network connectivity
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
18
Q

Can the Functions Premium plan connect to VNets?

A

Yes

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
19
Q

In the Functions Consumption Plan, are the Functions hosts added and removed dynamically based on the number of incoming events?

A

Yes

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
20
Q

When should you use a Dedicated Plan with Functions?

A

For long-running scenarios where Durable Functions cannot be used

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
21
Q

What other two hosting options, aside from Consumption, Premium, and Dedicated, are available for Functions?

A

ASE and Kubernetes

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
22
Q

What is KEDA?

A

Kubernetes-based Evemt Driven Autoscaling

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
23
Q

What setting should be enabled on the Dedicate Plan to make sure functions run correctly with no warm-up?

A

Always On

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
24
Q

What are the Azure Storage account requirements to run Functions?

A

A function app requires a general storage account which supports Blob, Queue, Files, and Table storage

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
25
What does Azure Functions use Azure Storage for?
Managing triggers, logging function invocations
26
Can you use the Storage Account for triggers and logging to store application data?
Yes. However, for storage-intensive operations you should use a separate storage account.
27
Do the Consumption and Premium plans scale CPU and memory with the number of events that trigger a function?
Yes. Additional Functions hosts are added as required
28
What's the memory and CPU footprint of a Functions host in the Consumption plan?
1.5 GB and one vCPU
29
Is an instance of a Functions host the entire function app?
Yes. All functions within a function app share resource within an instance, and scale at the same time
30
Do functions apps that share the same Consumption plan scale independently?
Yes.
31
In the Premium plan, do function apps in the plan scale independently?
No. The plan size determines the available memory and CPU for all app in that plan on that instance.
32
Where are Function code files stored.
In the Azure Files shares on the function's main storage account
33
What component monitors the rate of events sent to a function and determines where to scale out or scale in?
The scale controller.
34
What heuristic does the Scale Controller use with Azure Queue storage triggers?
It scales based on the queue length and the age of the oldest message
35
What is the unit of sale for Azure Functions?
The function app.
36
What is latency called when scaling up from zero Function host instances?
Cold Start
37
What factors affect how a Function App may scale?
The trigger and the selected laguage
38
What's the maximum number of instances a single function app can scale out too?
200 instances for Consumption Plan, 100 for Premium
39
Can a single instance process more than one message or request at a time?
Yes
40
How quickly can instances be allocated for HTTP Triggers?
At most, once per second
41
How quickly can instances be allocated for non-HTTP triggers?
At most, once every 30 seconds
42
Why would you limit the maximum number of instances an function app scales out too?
A downstream component, such as a database, has limited throughput
43
What value is used to specify the maximum number of instances an app can scale out too?
`functionAppScaleLimit`
44
What value would you set `functionAppScaleLimit` to for unrestricted scaling
`0` or `null`
45
How would scale using Azure Functions in an App Service Plan?
You could manually add instances to the service plan or you could autoscale. Autoscaling in an App Service Plan is slower than in the Premium Plan
46
What are the two important pieces of a function?
Your code, which can be written in different languages and some configuration in the functions.json file
47
How is the functions.json file created?
For compiled languages, it is automatically generated. For scripting languages, you must create the configuration file yourself.
48
What does the functions.json file define?
The function's trigger, its bindings, and other settings.
49
How many triggers does a function have?
Only one.
50
What does the runtime use the function.json file for?
To determine what events to monitor and how to pass data into and receive data from the function.
51
What is configured with the `binding` property?
Both bindings and the trigger.
52
What is the execution context for functions?
A function app.
53
What is the unit of deployment for functions?
A function app.
54
Can you have multiple functions in a function app?
Yes.
55
Are the pricing plan, deployment method, and runtime version shared across a function app?
Yes.
56
How many different languages can be used in function app in Functions 2.x?
Only one.
57
Does the folder structure required by a function app depend on the language used?
Yes.
58
How do you define triggers and bindings in a C# class library?
By decorating methods and parameters with attributes.
59
How do you define triggers and bindings in Java?
By decorating methods and parameters with annotations.
60
How do you define triggers and bindings in JavaScript/PowerShell/Python/TypeScript?
By updating function.json schema
61
What is the binding direction for triggers in the `function.json` file?
Always `in`.
62
What are the typical application patterns that can benefit from Durable Functions?
- Function Chaining - Fan-Out / Fan-In - Async HTTP APIs - Monitor - Human Interaction
63
Of what are Durable Function Apps comprised?
- Orchestrator Functions - Entity Functions
64
What are the four durable function types in Azure Functions?
- Orchestrator - Activity - Entity - Client
65
What is the purpose of Orchestrator functions?
To describe how actions are executed and their order.
66
Must Orchestrator functions be deterministic?
Yes.
67
How can you make sure that dates and times are consistent across replays of Orchestrator functions?
Use `IDurableOrchestrationContext.CurrentUtcDateTime`
68
How can you make sure that GUIDs are consistent across replays of Orchestrator functions?
Use `context.NewGuid()`
69
What are Activity Functions?
The basic unit of work in a durable function orchestration.
70
What are Entity Functions?
They are operations for reading and update small pieces of data.
71
What do Entity Functions do?
They manage state explicitly.
72
What do operations on entities require?
An entity identifier and an operation name.
73
How are Orchestrator and Entity functions triggered?
By their bindings. By types of functions trigger work by reacting to messages that enqueued in a task hub.
74
What makes a function a Client function?
Its use of the Durable Client Output binding.
75
What is a task hub in Durable Functions?
A logical container for durable storage resources used for orchestrations and entities.
76
Can Orchestrator, Activity, and Entity Functions interact with functions outside of their task hub?
No.
77
How many task hubs can a storage account contain?
Multiple.
78
What comprises a task hub in Azure Storage?
- One or more control queues - One work-item queue - One history table - One instances table - One storage container, containing one or more lease blobs - If applicable, a storage container for large message payloads
79
Where is the name of a task hub declared?
In the host.json file
80
What are the characteristics of an Orchestrator function?
- It defines workflows using procedural code - It can call other durable functions sync. and async. Output can reliably be saved to local variables - It is durable and reliable. Progress is checkpointed when the function awaits or yields. Local state is never lost when the process recycles or the VM reboots - It can be long-running
81
What is the format of an orchestration instance identifier?
By default an auto-generated GUID. Can be user-generated string.