Azure functions Flashcards

(39 cards)

1
Q

What are azure functions?

A

Azure functions is a serverless compute service that lets you run event triggered code.
without having to explicitly provision or manage infrastructure

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

How are azure functions used?

A

building microservices, processing data, integrating systems, and IoT

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

What are Azure Functions?

A

Azure Functions is a serverless compute service that enables you to run small pieces of code (functions) in response to events without explicitly managing infrastructure. You pay only for the execution time of your code.

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

How do azure functions scale?

A

they scale automatically based on demand.

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

What triggers can be used in azure functions?

A

http timer message queue blob storage

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

Binding

A

provide a declarative way to connect other azure services and external resources to your function

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

can bindings be input or output?

A

bindings can be input or output or both, they are used to pass data

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

How do azure functions handle dependencies?

A

supports nuget and npm packages allowing you to define dependencies.

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

consumption plan vs app service plan

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

What is the primary benefit of using Azure Functions?

A

The main benefits are cost efficiency, automatic scaling, and reduced operational overhead. Azure handles all the underlying infrastructure, allowing developers to focus solely on the code logic.

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

Explain the difference between Azure Functions and Azure App Services Web Apps.

A

Azure Functions is a serverless platform (FaaS - Function as a Service), ideal for event-driven, short-lived tasks with automatic scaling. Azure App Services Web Apps is a Platform as a Service (PaaS) offering for hosting full web applications where you have more control over the underlying infrastructure and a persistent environment.

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

What are triggers and bindings in Azure Functions?

A

Triggers: Define how a function is initiated
an HTTP request
a message in a Service Bus queue
a timer

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

What are bindings in Azure Functions?

A

Bindings: Provide a declarative way to connect data and services to your function without writing complex integration code. Bindings can be input (data into the function) or output (data sent from the function).

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

Name some common types of triggers used in Azure Functions.

A

Common triggers include
HTTP Trigger, Timer Trigger, Blob Storage Trigger, Azure Service Bus Queue/Topic Trigger, Event Hub Trigger, and Cosmos DB Trigger.

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

Can a single Azure Function have multiple triggers?

A

No, a single function can have only one trigger. However, it can have multiple input and output bindings.

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

How do you configure bindings in an Azure Function?

A

Bindings are defined in the function’s configuration file (function.json) or through attributes in compiled languages like C#. The Microsoft Azure documentation provides detailed guides on configuring different binding types.

17
Q

What are the different hosting plans available for Azure Functions?

A

Consumption Plan
Premium Plan
App Service Plan

18
Q

Consumption Plan

A

The default serverless plan, where you are billed per execution and Azure automatically manages the scaling.

19
Q

Premium Plan

A

Offers enhanced performance, VNet connectivity, and pre-warmed instances to avoid cold starts, with a predictable pricing model.

20
Q

App Service Plan

A

Allows functions to run on existing dedicated VMs alongside other App Services, offering consistent pricing and performance but requiring manual scaling management.

21
Q

What is a “cold start” and how can it be mitigated?

A

A cold start occurs when a serverless function is triggered after a period of inactivity, and the platform needs time to allocate and initialize the required resources. It can be mitigated by using the Premium hosting plan with pre-warmed instances.

22
Q

What programming languages are supported by Azure Functions?

A

Azure Functions supports multiple languages, including C#, F#, JavaScript, TypeScript, Python, and PowerShell.

23
Q

How can you test Azure Functions locally?

A

You can use the Azure Functions Core Tools extension in Visual Studio or VS Code to run and debug functions on your local machine before deployment.

24
Q

Explain different deployment methods for Azure Functions.

A

Common methods include Azure DevOps pipelines, GitHub Actions, Visual Studio publishing, Azure CLI, and FTP.

25
What are Azure Durable Functions?
Durable Functions is an extension of Azure Functions that lets you write stateful orchestrations and workflows in a serverless environment using code (C#, JavaScript, Python, etc.). It helps manage complex, long-running processes. functions calling other functions awaiting results and retrying
26
How do you handle configuration and secrets in Azure Functions?
Configuration values can be stored in the Azure Function App's Application Settings in the portal or in local.settings.json for local development. For sensitive data, it's best practice to use Azure Key Vault and reference the secrets in the application settings.
27
How do you monitor and debug Azure Functions in production?
Azure Application Insights provides robust monitoring, logging, and debugging capabilities, offering insights into execution counts, performance metrics, and potential errors.
28
how do you secure an azure function?
1 function keys which provide an API key-level authentication. 2 integration with active directory for O auth based security 3 IP restrictions to limit access to funtions from specified IP addresses 4 CORS setting to manage cross origin resources sharing
29
best practices for logging azure functions?
it is integrated with azure monitor and application insights for monitoring and logging 1 use built in ILogger 2 set appropriate log levels based on severity (info, warning, error) 3 include custom telemetry in logging to track usage and performance of functions
30
Azure function proxies?
define a single api surface for multiple functions more streamlined can route requests to functions or outside urls acting as a reverse proxy and facilitate a microservices architechture
31
how do you manage state ?
azure blob - large states azure table storage or cosmos db for structured data durable functions for stateful orchestrations
32
maximum execution timeout?
consumption plan 5 min, can be extended to 10 premium or dedicated (app service) plan - it can be unbounded
33
example use case
front end of web api can pass user photo to azure function for azure blob storage for compression blob trigger calls function, function compresses it, saves to blob less storage, cost savings uses signs up triggers azure function to send welcome email
34
serverless compute service lets yo run code in response to events without managing infrastructure
35
automatically scales and executes only when triggered cost effecient and light wieght
36
why not write function inside your main application?
37
steps to write azure function?
can be different language from main application run independantly from main application name function after function name add logic to run - this is the method that gets executed
38
azure function and function app?
single unit of execution runs from function trigger function app is the container that groups multiple azure functions
39
how would you send email when file uploaded to blob?
use a blob trigger mixing function code inside app increases coupling affect scalability performance maintainability