You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Suppose you run a social networking site for professionals. You're allowing your users to upload their headshot images to be posted on their profile. To reduce the workload on the web server, you want to create a serverless back end using Azure Functions to process this data. You want to create an image thumbnail and then save it to permanent storage.
1
+
Suppose you run a social networking site for professionals. You're allowing your users to upload their headshot images to be posted on their profile. To reduce the workload on the web server, you want to create a serverless back end using Azure Functions to process this data. You want to create an image thumbnail, and then save it to permanent storage.
2
2
3
3
The power of Azure Functions comes mainly from the integrations that it offers with a range of data sources and services, which are defined with *bindings*. With bindings, developers interact with other data sources and services without worrying about how the data flows to and from their function.
4
4
5
5
## Learning objectives
6
6
7
-
In this module, you will:
7
+
In this module, you'll:
8
8
9
-
- Explore the types of data sources that can be accessed through bindings
10
-
- Read data from Azure Cosmos DB by using Azure Functions
11
-
- Store data in Azure Cosmos DB by using Azure Functions
12
-
- Send messages to Azure Queue Storage by using Azure Functions
9
+
- Explore the types of data sources that can be accessed through bindings.
10
+
- Read data from Azure Cosmos DB by using Azure Functions.
11
+
- Store data in Azure Cosmos DB by using Azure Functions.
12
+
- Send messages to Azure Queue Storage by using Azure Functions.
Copy file name to clipboardExpand all lines: learn-pr/azure/chain-azure-functions-data-using-bindings/includes/2-explore-input-and-output-binding-types-portal-lesson.md
+12-12Lines changed: 12 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,7 +4,7 @@ Accessing and processing data are key tasks in many software solutions. Consider
4
4
- You want to post incoming messages to a queue for processing by another component in your enterprise.
5
5
- Your service needs to grab gamer scores from a queue and update an online scoreboard.
6
6
7
-
All of these examples are about moving data. The data source and destinations differ from scenario to scenario, but the pattern is similar. You connect to a data source, and you read and write data. Azure Functions helps you integrate with data and services by using bindings.
7
+
All of these examples are about moving data. The data source and destinations differ from scenario to scenario, but the pattern is similar. You connect to a data source, and you read and write data. Azure Functions helps you integrate with data and services by using bindings.
8
8
9
9
## What is a binding?
10
10
@@ -14,15 +14,15 @@ In Azure Functions, bindings provide a declarative way to connect to data from w
14
14
15
15
There are two kinds of bindings you can use with functions:
16
16
17
-
-**Input binding** - Connects to a data **source**. Our function can read data from these input sources.
17
+
-**Input binding**: Connects to a data **source**. Our function can read data from these input sources.
18
18
19
-
-**Output binding** - Connects to a data **destination**. Our function can write data to these output destinations.
19
+
-**Output binding**: Connects to a data **destination**. Our function can write data to these output destinations.
20
20
21
21
There are also _triggers_, which are special types of input bindings that cause a function to run. For example, an Azure Event Grid notification can be configured as a trigger. When an event occurs, the function runs.
22
22
23
23
### Types of supported bindings
24
24
25
-
The *type* of binding defines where we're reading or sending data. There's a binding to respond to web requests, and a large selection of bindings to interact directly with various Azure services and third-party services.
25
+
The _type_ of binding defines where we're reading or sending data. There's a binding to respond to web requests, and a large selection of bindings to interact directly with various Azure services and third-party services.
26
26
27
27
A binding type can be used as an input, an output, or both. For example, a function can write to a Blob Storage output binding, but a Blob Storage update could trigger another function.
28
28
@@ -42,21 +42,21 @@ These types are just a sample. There are more, plus functions have an extensibil
42
42
43
43
Three properties are required in all bindings, though you might have to supply more properties based on the type of binding and storage you're using.
44
44
45
-
-**Name** - Defines the function parameter through which you access the data. For example, in a queue input binding, this property is the name of the function parameter that receives the queue message content.
45
+
-**Name**: Defines the function parameter through which you access the data. For example, in a queue input binding, this property is the name of the function parameter that receives the queue message content.
46
46
47
-
-**Type** - Identifies the type of binding. For example, the type of data or service you want to interact with.
47
+
-**Type**: Identifies the type of binding. For example, the type of data or service you want to interact with.
48
48
49
-
-**Direction** - Indicates the direction data is flowing. For example, is it an input or output binding?
49
+
-**Direction**: Indicates the direction data is flowing. For example, is it an input or output binding?
50
50
51
51
Additionally, most binding types also need a fourth property:
52
52
53
-
-**Connection** - Provides the name of an app setting key that contains the connection string. Bindings use connection strings stored in app settings to keep secrets out of the function code. Connection strings make your code more configurable and secure.
53
+
-**Connection**: Provides the name of an app setting key that contains the connection string. Bindings use connection strings stored in app settings to keep secrets out of the function code. Connection strings make your code more configurable and secure.
54
54
55
55
## Create a binding
56
56
57
-
Bindings are defined in JSON. A binding is configured in your function's configuration file, which is named *function.json* and lives in the same folder as your function code.
57
+
Bindings are defined in JSON. A binding is configured in your function's configuration file, which is named _function.json_ and lives in the same folder as your function code.
58
58
59
-
Let's examine a sample *input binding*:
59
+
Let's examine a sample _input binding_:
60
60
61
61
```json
62
62
...
@@ -72,13 +72,13 @@ Bindings are defined in JSON. A binding is configured in your function's configu
72
72
73
73
To create this binding, we:
74
74
75
-
1. Create a binding in our *function.json* file.
75
+
1. Create a binding in our _function.json_ file.
76
76
77
77
1. Provide the value for the `name` variable. In this example, the variable holds the blob data.
78
78
79
79
1. Provide the storage `type`. In the preceding example, we're using Blob Storage.
80
80
81
-
1. Provide the `path`, which specifies the container and the item name that goes in it. The `path` property is required when using the blob trigger, and should be provided in the style shown here, with curly braces around the filename portion of the path. This syntax creates a *binding expression* that allows you to reference the blob's name in other bindings, and in your function's code. In this example, a parameter on the function named *filename* would be populated with the filename of the blob that triggered the function.
81
+
1. Provide the `path`, which specifies the container and the item name that goes in it. The `path` property is required when using the blob trigger and should be provided in the style shown here, with curly braces around the filename portion of the path. This syntax creates a _binding expression_ that allows you to reference the blob's name in other bindings and in your function's code. In this example, a parameter on the function named _filename_ would be populated with the filename of the blob that triggered the function.
82
82
83
83
1. Provide the `connection` string setting name defined in the application's settings file. The name is used as a key to find the connection string to connect to your storage account.
Copy file name to clipboardExpand all lines: learn-pr/azure/chain-azure-functions-data-using-bindings/includes/3-explore-input-and-output-binding-types-portal-lab.md
+6-6Lines changed: 6 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -12,7 +12,7 @@ The parameter `req` is the *trigger binding*, and the parameter `res` is the *ou
12
12
13
13
::: zone pivot="powershell"
14
14
15
-
:::image type="content" source="../media/3-default-http-trigger-implementation-powershell-small.png" alt-text="Screenshot of Code and Test pane showing default code for HTTP trigger function template." lightbox="../media/3-default-http-trigger-implementation-powershell.png":::
15
+
:::image type="content" source="../media/3-default-http-trigger-implementation-powershell-small.png" alt-text="Screenshot of Code and Test pane showing default code for HTTP trigger function template." lightbox="../media/3-default-http-trigger-implementation-powershell.png":::
16
16
17
17
The parameter `Request` is the *trigger binding*, and the parameter `Response` is the *output binding*.
18
18
@@ -99,7 +99,7 @@ Now that we have a function app, it's time to create a function. Each function h
99
99
100
100
:::image type="content" source="../media/3-add-function-small.png" alt-text="Screenshot for the Create Function pane." lightbox="../media/3-add-function.png":::
101
101
102
-
1. In the **Select a template** section, select the **HTTP trigger** template, then select **Next**.
102
+
1. In the **Select a template** section, select the **HTTP trigger** template, and then select **Next**.
103
103
104
104
1. In the **Template details** section, confirm the following settings.
105
105
@@ -301,15 +301,15 @@ Now that we have a function app, let's create a function. Each function has a tr
301
301
302
302
:::image type="content" source="../media/3-function-integration-vertical-small.png" alt-text="Screenshot of vertical flow diagram showing Trigger and Inputs leading to Function and Function leading to Outputs." lightbox="../media/3-function-integration-vertical.png":::
303
303
304
-
You can see that we can't add more than _one_ trigger. To change a trigger for a function, you need to delete the trigger and create a new one. However, the **Inputs** and **Outputs** sections enable you to add more than one binding, so the request can accept more than one input value and return more than one output value.
304
+
You can see that we can't add more than *one* trigger. To change a trigger for a function, you need to delete the trigger and create a new one. However, the **Inputs** and **Outputs** sections enable you to add more than one binding, so the request can accept more than one input value and return more than one output value.
305
305
306
306
1. In the **Inputs** box, select **Add input**. The **Create Input** pane appears. Select the dropdown list for **Binding Type** to view a list of all possible input binding types.
307
307
308
308
:::image type="content" source="../media/3-function-input-bindings.png" alt-text="Screenshot of the Add input options.":::
309
309
310
310
Take a moment to consider how you might use each of these input bindings in a solution.
311
311
312
-
Later in this module, we add input bindings, but for now, select **Cancel** to dismiss this pane.
312
+
Later in this module, we add input bindings. For now, select **Cancel** to dismiss this pane.
313
313
314
314
1. In the **Outputs** box, select **Add output**. The **Create Output** pane appears. Select the dropdown list for **Binding Type** to view a list of all possible output binding types.
315
315
@@ -341,8 +341,8 @@ Now that we have a function app, let's create a function. Each function has a tr
341
341
342
342
:::image type="content" source="../media/3-function-output-bindings.png" alt-text="Screenshot of the Add output options.":::
343
343
344
-
As you can see, there are several output binding types. Later in this module, we add output bindings but, for now, select **Cancel** to dismiss this pane.
344
+
As you can see, there are several output binding types. Later in this module, we add output bindings. For now, select **Cancel** to dismiss this pane.
345
345
346
346
::: zone-end
347
347
348
-
So far, we learned how to create a function app and add a function to it. We saw a simple function in action--one that runs when an HTTP request is made. We also explored the Azure portal and the types of input and output bindings that are available to functions. In the next unit, we'll use an input binding to read text from a database.
348
+
So far, we learned how to create a function app and add a function to it. We saw a simple function in action, which is one that runs when an HTTP request is made. We also explored the Azure portal and the types of input and output bindings that are available to functions. In the next unit, we'll use an input binding to read text from a database.
Copy file name to clipboardExpand all lines: learn-pr/azure/chain-azure-functions-data-using-bindings/includes/4-read-data-with-input-bindings-portal-lesson.md
+7-7Lines changed: 7 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,21 +4,21 @@ To connect to a data source, you need to configure an *input binding*. An input
4
4
5
5
Azure chain functions can have multiple types of input. However, not all types support both input and output. Use an input function whenever you want to ingest data of that type. Here, we look at the input function types that support input bindings and when to use them.
6
6
7
-
-**Azure Blob Storage** - Blob Storage bindings allow you to read from a blob.
7
+
-**Azure Blob Storage**: Blob Storage bindings allow you to read from a blob.
8
8
9
-
-**Azure Cosmos DB** - Azure Cosmos DB input bindings use the SQL API to retrieve one or more Azure Cosmos DB documents, and pass them to the input parameter of the function. The document ID, or query parameters, can be determined based on the trigger that invokes the function.
9
+
-**Azure Cosmos DB**: Azure Cosmos DB input bindings use the SQL API to retrieve one or more Azure Cosmos DB documents, and pass them to the input parameter of the function. The document ID, or query parameters, can be determined based on the trigger that invokes the function.
10
10
11
-
-**Mobile Apps** - A Mobile Apps input binding loads a record from a mobile table endpoint and passes it into your function.
11
+
-**Mobile Apps**: A Mobile Apps input binding loads a record from a mobile table endpoint and passes it into your function.
12
12
13
-
-**Azure Table storage** - You can read data and work with Azure Table storage.
13
+
-**Azure Table storage**: You can read data and work with Azure Table storage.
14
14
15
-
A full listing of supported bindings is available [here](/azure/azure-functions/functions-triggers-bindings?tabs=csharp#supported-bindings)
15
+
A full listing of supported bindings is available [here.](/azure/azure-functions/functions-triggers-bindings?tabs=csharp#supported-bindings)
16
16
17
17
To create a binding as an input, you must define `direction` as `in`. The parameters for each type of binding might vary.
18
18
19
19
## What is a binding expression?
20
20
21
-
A binding expression is specialized text in *function.json*, function parameters, or code that is evaluated when the function is invoked, to yield a value. For example, if you have a Service Bus Queue binding, you could use a binding expression to obtain the name of the queue from App Settings.
21
+
A binding expression is specialized text in *function.json*, function parameters, or code that is evaluated when the function is invoked to yield a value. For example, if you have a Service Bus Queue binding, you could use a binding expression to obtain the name of the queue from App Settings.
22
22
23
23
### Types of binding expressions
24
24
@@ -31,7 +31,7 @@ There are several types of binding expressions, including:
31
31
- New GUID
32
32
- Current date and time
33
33
34
-
Most binding expressions are identified by being wrapped in curly braces. However, app setting binding expressions are wrapped in percent signs, rather than curly braces. For example, if the blob output binding path is `%Environment%/newblob.txt`, and the Environment app setting value is *Development*, a blob is created in the Development container.
34
+
Most binding expressions are identified by being wrapped in curly braces. However, app setting binding expressions are wrapped in percent signs rather than curly braces. For example, if the blob output binding path is `%Environment%/newblob.txt`, and the Environment app setting value is *Development*, a blob is created in the Development container.
0 commit comments