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
Q

What does Azure Functions use Azure Storage for?

A

Managing triggers, logging function invocations

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

Can you use the Storage Account for triggers and logging to store application data?

A

Yes. However, for storage-intensive operations you should use a separate storage account.

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

Do the Consumption and Premium plans scale CPU and memory with the number of events that trigger a function?

A

Yes. Additional Functions hosts are added as required

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

What’s the memory and CPU footprint of a Functions host in the Consumption plan?

A

1.5 GB and one vCPU

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

Is an instance of a Functions host the entire function app?

A

Yes. All functions within a function app share resource within an instance, and scale at the same time

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

Do functions apps that share the same Consumption plan scale independently?

A

Yes.

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

In the Premium plan, do function apps in the plan scale independently?

A

No. The plan size determines the available memory and CPU for all app in that plan on that instance.

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

Where are Function code files stored.

A

In the Azure Files shares on the function’s main storage account

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

What component monitors the rate of events sent to a function and determines where to scale out or scale in?

A

The scale controller.

34
Q

What heuristic does the Scale Controller use with Azure Queue storage triggers?

A

It scales based on the queue length and the age of the oldest message

35
Q

What is the unit of sale for Azure Functions?

A

The function app.

36
Q

What is latency called when scaling up from zero Function host instances?

A

Cold Start

37
Q

What factors affect how a Function App may scale?

A

The trigger and the selected laguage

38
Q

What’s the maximum number of instances a single function app can scale out too?

A

200 instances for Consumption Plan, 100 for Premium

39
Q

Can a single instance process more than one message or request at a time?

A

Yes

40
Q

How quickly can instances be allocated for HTTP Triggers?

A

At most, once per second

41
Q

How quickly can instances be allocated for non-HTTP triggers?

A

At most, once every 30 seconds

42
Q

Why would you limit the maximum number of instances an function app scales out too?

A

A downstream component, such as a database, has limited throughput

43
Q

What value is used to specify the maximum number of instances an app can scale out too?

A

functionAppScaleLimit

44
Q

What value would you set functionAppScaleLimit to for unrestricted scaling

A

0 or null

45
Q

How would scale using Azure Functions in an App Service Plan?

A

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
Q

What are the two important pieces of a function?

A

Your code, which can be written in different languages and some configuration in the functions.json file

47
Q

How is the functions.json file created?

A

For compiled languages, it is automatically generated. For scripting languages, you must create the configuration file yourself.

48
Q

What does the functions.json file define?

A

The function’s trigger, its bindings, and other settings.

49
Q

How many triggers does a function have?

A

Only one.

50
Q

What does the runtime use the function.json file for?

A

To determine what events to monitor and how to pass data into and receive data from the function.

51
Q

What is configured with the binding property?

A

Both bindings and the trigger.

52
Q

What is the execution context for functions?

A

A function app.

53
Q

What is the unit of deployment for functions?

A

A function app.

54
Q

Can you have multiple functions in a function app?

A

Yes.

55
Q

Are the pricing plan, deployment method, and runtime version shared across a function app?

A

Yes.

56
Q

How many different languages can be used in function app in Functions 2.x?

A

Only one.

57
Q

Does the folder structure required by a function app depend on the language used?

A

Yes.

58
Q

How do you define triggers and bindings in a C# class library?

A

By decorating methods and parameters with attributes.

59
Q

How do you define triggers and bindings in Java?

A

By decorating methods and parameters with annotations.

60
Q

How do you define triggers and bindings in JavaScript/PowerShell/Python/TypeScript?

A

By updating function.json schema

61
Q

What is the binding direction for triggers in the function.json file?

A

Always in.

62
Q

What are the typical application patterns that can benefit from Durable Functions?

A
  • Function Chaining
  • Fan-Out / Fan-In
  • Async HTTP APIs
  • Monitor
  • Human Interaction
63
Q

Of what are Durable Function Apps comprised?

A
  • Orchestrator Functions
  • Entity Functions
64
Q

What are the four durable function types in Azure Functions?

A
  • Orchestrator
  • Activity
  • Entity
  • Client
65
Q

What is the purpose of Orchestrator functions?

A

To describe how actions are executed and their order.

66
Q

Must Orchestrator functions be deterministic?

A

Yes.

67
Q

How can you make sure that dates and times are consistent across replays of Orchestrator functions?

A

Use IDurableOrchestrationContext.CurrentUtcDateTime

68
Q

How can you make sure that GUIDs are consistent across replays of Orchestrator functions?

A

Use context.NewGuid()

69
Q

What are Activity Functions?

A

The basic unit of work in a durable function orchestration.

70
Q

What are Entity Functions?

A

They are operations for reading and update small pieces of data.

71
Q

What do Entity Functions do?

A

They manage state explicitly.

72
Q

What do operations on entities require?

A

An entity identifier and an operation name.

73
Q

How are Orchestrator and Entity functions triggered?

A

By their bindings. By types of functions trigger work by reacting to messages that enqueued in a task hub.

74
Q

What makes a function a Client function?

A

Its use of the Durable Client Output binding.

75
Q

What is a task hub in Durable Functions?

A

A logical container for durable storage resources used for orchestrations and entities.

76
Q

Can Orchestrator, Activity, and Entity Functions interact with functions outside of their task hub?

A

No.

77
Q

How many task hubs can a storage account contain?

A

Multiple.

78
Q

What comprises a task hub in Azure Storage?

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

Where is the name of a task hub declared?

A

In the host.json file

80
Q

What are the characteristics of an Orchestrator function?

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

What is the format of an orchestration instance identifier?

A

By default an auto-generated GUID. Can be user-generated string.