Implement IaaS, Azure Functions Flashcards

1
Q

From a top level view, What are Azure Functions

A

Azure Functions allows to run small peaces of code (function) on scalable infrastructure.

A functions execution is triggered by an event.

Outpunts of functions are streamlined by bindings.

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

What causes a Azure App Function to run

A

A trigger

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

True Or False? Azure Functions can have multiple triggers?

A

False, must have exactly one trigger

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

In Azure Functions, what is the purpose of Bindings

A

Binding to a function is a way of declarativley connecting another resource to the function

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

True or False? Bindings can be connected as Input, output, or both

A

True

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

How is data from bindings provided to a function

A

As function parameter

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

True or False? Bindings are optional for Azure App Functions

A

True

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

In the following scenario, what is the Input Trigger, Input Binding and Output Binding:

A new queue message arrives which runs a function to write to another queue.

A

Trigger:Queue
Input binding:
Output Binding:Queue

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

In the following scenario, what is the Input Trigger, Input Binding and Output Binding:

A scheduled job reads Blob Storage contents and creates a new Cosmos DB document.

A

Trigger: Timer
Input binding: Blob Storage
Output Binding: Cosmos DB

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

How are Azure Function triggers and binding definitions defined in C#

A

Decorate Methods and parameters with C# Attributes

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

How are Azure Function triggers and binding definitions used in Everyting else except C# (Including Azure Portal)

A

By Updating the content of function.json

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

True or False: the binding direction for triggers is always ‘out’

A

False

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

What identifies a trigger in a functions.json

A

type is something “xxxTrigger” and direction is “in”

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

What identifies a binding in a functions.json

A

type is something “xxxBinding” and direction is “in” or “out”

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

What identifies the function in a functions.json

A

Property name

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

What are Durable Functions?

A

An extension of Azure Function, functions with state

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

What is meant by Orchestrator function

A

A function that calls multiple functions as a workflow

18
Q

True or false? The total lifespan of an orchestration instance can be seconds, days, months, or never-ending

A

True

19
Q

What is a task hub?

A

A task hub is a logical container used for durable functions. Orchestrator and activity functions can only interact with each other when they belong to the same task hub.

20
Q

How is an orchestration identified

A

Instance Identifier is by default GUID, must be unique within a task hub

21
Q

True or false? Orchestration Instance Identifier can be user defined

A

True, but must be unique within a task hub

22
Q

How to test Azure Functions locally?

A

Use Azure Storage Simulator

23
Q

What is meant by “Consumption Plan” in Azure Functions context ?

A

Pay only for Executions of the App. Billing is based on number of executions, execution time and memory used.

24
Q

How does Pattern Function Chaining work?

A

Multiple F1 .. Fn functions called in ordered sequence, Output from Fx is is applied as Input to Fx+1

25
Q

How does Pattern Fan out / fan in work in durable functions?

A

Fan out: Execute multiple functions parallel. Fan In: Then wait for all functions to finish, for example on aggregation work. => basically Task.WhenAll

26
Q

Explain Async HTTP APIs Pattern

A

The async HTTP API pattern addresses the problem of coordinating the state of long-running operations with external clients. A common way to implement this pattern is by having an HTTP endpoint trigger the long-running action. Then, redirect the client to a status endpoint that the client polls to learn when the operation is finished.

Durable Functions handle this automatically, no manual state programming/handling required.

27
Q

Explain the Monitor Pattern

A

The monitor pattern refers to a flexible, recurring process in a workflow. An example is polling until specific conditions are met. You can use Durable Functions to create flexible recurrence intervals, manage task lifetimes, and create multiple monitor processes from a single orchestration.

28
Q

How to wait for Human interaction in durable functions?

A

Wait for an external event (The Human interaction). If this event is not coming within a timeout, escelate, otherwise proceed as intended.

29
Q

What is this doing?
using (await context.LockAsync(sourceEntity, destinationEntity))
{ .. }

A

In Entity Functions, this is used for scenarios to make writes to entity state thread safe

30
Q

You work for a company that makes TV adverts. You want to formalize two business processes:

The advert review process. A completed advert is put through this editorial process to ensure that it meets the standards of taste, decency, grammar, style, and legal requirements in the jurisdiction where it will be broadcast.
The feedback collection process. A completed advert is also put through this process in which customers, the director, and members of the board of directors, can give feedback.
The advert review process should be managed by members of the creative team, because it will need to change regularly. The creative team would prefer not to have to wait for a developer to become available whenever a change is needed.

The feedback collection process calls an on-premises SharePoint server. Because this server is not as reliable as a cloud-based server would be, developers want to carefully control the way the workflow retries this connection, if there is a failure.

1) Which technology would you use for the advert review process?

  • Microsoft Power Automate
  • Azure Logic Apps
  • Azure Functions
  • Azure App Service WebJobs

2) Which technology would you use for the feedback collection process?

  • Microsoft Power Automate
  • Azure Logic Apps
  • Azure Functions
  • Azure App Service WebJobs
A

1) Implement the workflow using Microsoft Power Automate because this allows the creative team, who are not developers, to manage the flow.
2) WebJobs are the only technology that permits developers to control retry policies.

31
Q

You work for a company that makes digital cameras. The company has recently acquired a smaller company that makes lenses. You want to ensure that the same procedures are in use throughout the company for the following processes:

Lens quality control. The company you acquired has a good reputation for lens reliability because of its quality control procedure. You want to implement this procedure across the merged company and integrate it with your parts ordering system, which includes a REST API.
Ordering and dispatch. The company you acquired had no formal order and dispatch procedure, so you want to ensure its employees use your original business procedure. The ordering system has a user interface that is built as an Azure App service web app but you want to manage the order and dispatch workflow as a separate project.
You have hired a small team of developers to do the work and you prefer a design-first approach.

1) Which technology would you use for the lens quality control procedure?

  • Microsoft Power Automate
  • Azure Logic Apps
  • Azure Functions
  • Azure App Service WebJobs

2) In the merged camera company, which technology would you use for the ordering and dispatch procedure?

  • Microsoft Power Automate
  • Azure Logic Apps
  • Azure Functions
  • Azure App Service WebJobs
A

1) Azure Logic Apps is the only one of the four technologies that provides a design-first approach intended for developers.
2) Azure Logic Apps is the only one of the four technologies that provides a design-first approach intended for developers. (no copy paste issue here)

32
Q

Which of the following best defines serverless logic?

Code you write that doesn’t run on servers.

Code you write that runs on servers you manage.

Code you write that runs on servers a cloud provider manages.

A

Code you write that runs on servers a cloud provider manages.

33
Q

The container that groups functions into a logical unit for easier management, deployment, and sharing of resources is called?

Resource group

Function app

Function collection

A

Function app

34
Q

We secured our function against unknown HTTP callers by requiring a function-specific API key be passed with each call. Which of the following fields is the name header in the HTTP requests that needs to contain this key?

x-functions-key

x-requested-with

x-csrf-token

A

x-functions-key

35
Q

A CRON expression is a string that consists of six fields that represent a set of times. The order of the six fields in Azure is: {second} {minute} {hour} {day} {month} {day of the week}. Suppose you needed a CRON expression that meant “every day”, what special character would you put in the {day of the week} position?

/

*

,

A

*

36
Q

Suppose your Azure Function has a blob trigger associated with it and you want it to execute only when images are uploaded. Which of the following blob trigger Path values should you use?

samples-workitems/{name}

samples-workitems/{name}/png

samples-workitems/{name}?png

samples-workitems/{name}.png

A

samples-workitems/{name}.png

37
Q

Which of the following is an advantage of using bindings in your Azure Functions to access data sources and data sinks?

They provide access to more data sources than are available using code.

They let you connect to Azure resources without authentication.

They simplify the connection process; you don’t need to code specific connection logic.

A

They simplify the connection process; you don’t need to code specific connection logic.

Bindings provide a declarative way to connect to data. They let you avoid the complexity of coding connection logic like making a database connection or invoking web API interfaces.

38
Q

What is the purpose of Azure API Management

A

Combine multiple Azure Functions into a web api

MS Definition: The Azure API Management (APIM) service enables you to construct an API from a set of disparate microservices

39
Q

When using Azure API Management, how is a single microservice implemented / represented?

A

By using an Azure Function

40
Q

True or False? API Management acts as an intermediary (mediator)?

A

True

It forwards requests to the right microservice, wherever it is located, and returns responses to users. Users never see the different URIs where microservices are hosted.

41
Q

True or False? You can use API Management policies to enforce consistent rules on all microservices in the product.

A

True

For example, you can transform all XML responses into JSON, if that is your preferred format.