Develop Azure Functions Flashcards

1
Q

What are the two things that functions contain in terms of development?

A
  • code and config AKA functions.json
  • compiled languages the config is generated automatically from annotations in code
  • scripting languages you must provide the config file yourself
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is functions.json?

A
  • defines the functions trigger, binding and other config settings
  • every function has 1 and only 1 trigger
  • the runtime uses this config to determine the events to monitor and how to pass data into and out of a function execution
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What is the bindings property in functions.json?

A
  • where you configure both triggers and bindings
  • each binding shares a few common settings and some setting are specific to certain bindings
  • Common settings are; type, direction and name
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What is a function app?

A
  • provides an exeuction context in azure for which your functions run
  • organises and collectively manages apps
  • contains one or more functions that are managed, deployed and scaled together
  • all functions in app share the same pricing plan, deployment method and runtime version
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What are some key files in a functions project?

A
  • host.json file is in the root folder and contains runtime-specific config
  • bin folder contains packages and other library files that the app requires
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

How can we debug azure functions locally?

A
  • can connect them directly to live azure services and use the local.settings.json file
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What is a function binding?

A
  • a way of declaratively connecting another resource to the function
  • can be input, output or both
  • data from bindings is provided to the function as params
  • they are optional, a function may have none or many
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What is the main advantage of triggers and bindings?

A
  • let you avoid hardcoding access to other services
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

How are trigger and bindings defined for different programming languages?

A

.NET uses decorating methods and params with C# attribs
JAVA uses decorating method and params with java annotations
- JS/Typescript/Python/PS uses the function.json schema

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

What is the direction property?

A
  • all triggers and bindings have this property in the functions.json file
  • for triggers the direction is always in
  • input and output bindings use in and out
  • some bindings support inout
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

How does a function project reference connection info?

A
  • By name from its config provider
  • doesn’t directly accept the connection details allowing them to be changed across environments
  • the default config provider uses environment vars that are set in app settings when running in az functions service or from local settings file
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

How do az functions utilize identities?

A
  • can use ID instead of secret
  • support depends on the extension using the connection
  • in some cases a conn string may still be required in functions
  • when hosted in az functions service ID based connections use a managed ID
  • sysmtem-assigned ID is default but a user-assigned can be specified with credential and clientID properties
  • when ran in local envs your dev ID is used instead
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What must identities have to use azure functions?

A
  • must have permissions to perform the intended actions
  • this is done by assigning an RBAC role or by specifying the ID in an access policy
How well did you know this?
1
Not at all
2
3
4
5
Perfectly