Implement Azure Functions Flashcards

1
Q

Your company has developed an application that needs to be able to accept, store, and process images. This application utilizes Azure App Services to host the web app, utilizes OAuth for authentication, and uses a General-Purpose v2 Blob Storage account for the images. You’ve been asked to ensure images uploaded are processed to create a better experience for people viewing from mobile devices by converting them to more manageable sizes & formats. The process should only run when new images are uploaded or updated. What is the best method to achieve this result?

  • Use Azure Storage Blob Compression to process images as they come in
  • Create a Function that is triggered whenever an upload request comes through the webapp, catching the image before it lands in the Blob Storage Account
  • Build an Event Hub trigger event that kicks off a Function that will process the images.
  • Build an Azure Function that uses a Blob Storage Trigger for any changes and runs whenever it detects new images or when an image is updated.
A

-Build an Azure Function that uses a Blob Storage Trigger for any changes and runs whenever it detects new images or when an image is updated.

Polling the blob container for updates creates a simple and efficient method of triggering your function.

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

Which of the following are valid Azure Function Triggers? (Choose 3.)

  • IoT
  • HTTP
  • Service Bus
  • Webhook
  • App Service
  • JavaScript
A

-HTTP
A HTTP Trigger is a basic and simple trigger for your Azure Function.

-Service Bus
Use the Service Bus trigger to respond to messages from a Service Bus queue or topic. I like buses.

-Webhook
If an external system supports webhooks, it can be configured to call an Azure Functions Webhook using HTTP and pass on relevant data.

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

What is the most cost effective service to host funtions that are expected to have minimum use?

A

Use a consumption model.

The first 1 million function requests every month are free

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

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

What are the relevant Trigger, Input binding and Output binding to use in this scenario?

List of bindings/triggers:

  • Queue
  • Timer
  • Event Grid
  • HTTP
  • None
  • Blob Storage
  • Cosmos DB
  • SendGrid
  • Microsoft Graph
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
5
Q

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

What are the relevant Trigger, Input binding and Output binding to use in this scenario?

List of bindings/triggers:

  • Queue
  • Timer
  • Event Grid
  • HTTP
  • None
  • Blob Storage
  • Cosmos DB
  • SendGrid
  • Microsoft Graph
A

Trigger: Queue
Input binding: None
Output Binding: Queue

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

Which application patterns can benefit from durable functions? (Choose all that apply.)

    Aggregator
    Sharding
    Gatekeeper
    Function chaining
    Cache-aside
    Fan-out/fan-in
    Federated Identity
    Valet Key
    Monitoring
A

Fan-out/fan-in
Aggregator
Monitoring
Function chaining

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

True Or False? Azure Functions can have multiple triggers?

A

False

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

How is data from bindings provided to a function?

A

As a function parameter

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

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

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