Skip to content

Commit bc587ac

Browse files
authored
Merge pull request #190747 from MicrosoftDocs/release-functions-bindings-refactor
[FUNCTIONS] Release branch merge to main--Scheduled release ASAP
2 parents 29a7f3f + 1c9a054 commit bc587ac

File tree

112 files changed

+5648
-3372
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

112 files changed

+5648
-3372
lines changed

.openpublishing.redirection.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6858,6 +6858,11 @@
68586858
"redirect_url": "/azure/azure-functions/functions-kubernetes-keda",
68596859
"redirect_document_id": false
68606860
},
6861+
{
6862+
"source_path_from_root": "/articles/azure-functions/functions-bindings-event-iot-output.md",
6863+
"redirect_url": "/azure/azure-functions/functions-bindings-event-hubs-output",
6864+
"redirect_document_id": false
6865+
},
68616866
{
68626867
"source_path_from_root": "/articles/azure-government/documentation-government-k8.md",
68636868
"redirect_url": "/azure/azure-government",

articles/app-service/webjobs-sdk-how-to.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -397,7 +397,7 @@ static async Task Main()
397397
}
398398
```
399399

400-
For more information, see the [Azure CosmosDB binding](../azure-functions/functions-bindings-cosmosdb-v2-output.md#hostjson-settings) article.
400+
For more information, see the [Azure CosmosDB binding](../azure-functions/functions-bindings-cosmosdb-v2.md#hostjson-settings) article.
401401

402402
#### Event Hubs trigger configuration (version 3.*x*)
403403

@@ -526,7 +526,7 @@ static async Task Main()
526526
}
527527
```
528528

529-
For more details, see the [Service Bus binding](../azure-functions/functions-bindings-service-bus.md#hostjson-settings) article.
529+
For more details, see the [Service Bus binding](../azure-functions/functions-bindings-service-bus.md) article.
530530

531531
### Configuration for other bindings
532532

@@ -684,7 +684,7 @@ The Azure Functions documentation provides reference information about each bind
684684

685685
* [Packages](../azure-functions/functions-bindings-storage-queue.md). The package you need to install to include support for the binding in a WebJobs SDK project.
686686
* [Examples](../azure-functions/functions-bindings-storage-queue-trigger.md). Code samples. The C# class library example applies to the WebJobs SDK. Just omit the `FunctionName` attribute.
687-
* [Attributes](../azure-functions/functions-bindings-storage-queue-trigger.md#attributes-and-annotations). The attributes to use for the binding type.
687+
* [Attributes](../azure-functions/functions-bindings-storage-queue-trigger.md#attributes). The attributes to use for the binding type.
688688
* [Configuration](../azure-functions/functions-bindings-storage-queue-trigger.md#configuration). Explanations of the attribute properties and constructor parameters.
689689
* [Usage](../azure-functions/functions-bindings-storage-queue-trigger.md#usage). The types you can bind to and information about how the binding works. For example: polling algorithm, poison queue processing.
690690

articles/azure-functions/TOC.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,8 @@
198198
href: functions-deployment-technologies.md
199199
- name: Events and messaging
200200
items:
201+
- name: Connect to services
202+
href: event-messaging-bindings.md
201203
- name: Event-driven scaling
202204
href: event-driven-scaling.md
203205
- name: Reliable event processing
@@ -477,6 +479,8 @@
477479
href: functions-add-output-binding-storage-queue-vs-code.md
478480
- name: Storage - Visual Studio
479481
href: functions-add-output-binding-storage-queue-vs.md
482+
- name: Work with Event Grid
483+
href: event-grid-how-tos.md
480484
- name: Start/Stop VMs
481485
items:
482486
- name: Overview
@@ -620,9 +624,6 @@
620624
- name: Trigger
621625
href: functions-bindings-event-iot-trigger.md
622626
displayName: Azure IoT Hubs
623-
- name: Output
624-
href: functions-bindings-event-iot-output.md
625-
displayName: Azure IoT Hubs
626627
- name: Kafka
627628
href: https://github.com/azure/azure-functions-kafka-extension
628629
- name: HTTP and webhooks

articles/azure-functions/event-driven-scaling.md

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ Scaling can vary on a number of factors, and scale differently based on the trig
3232

3333
* **Maximum instances:** A single function app only scales out to a maximum of 200 instances. A single instance may process more than one message or request at a time though, so there isn't a set limit on number of concurrent executions. You can [specify a lower maximum](#limit-scale-out) to throttle scale as required.
3434
* **New instance rate:** For HTTP triggers, new instances are allocated, at most, once per second. For non-HTTP triggers, new instances are allocated, at most, once every 30 seconds. Scaling is faster when running in a [Premium plan](functions-premium-plan.md).
35-
* **Scale efficiency:** For Service Bus triggers, use _Manage_ rights on resources for the most efficient scaling. With _Listen_ rights, scaling isn't as accurate because the queue length can't be used to inform scaling decisions. To learn more about setting rights in Service Bus access policies, see [Shared Access Authorization Policy](../service-bus-messaging/service-bus-sas.md#shared-access-authorization-policies). For Event Hub triggers, see the [scaling guidance](functions-bindings-event-hubs-trigger.md#scaling) in the reference article.
35+
* **Scale efficiency:** For Service Bus triggers, use _Manage_ rights on resources for the most efficient scaling. With _Listen_ rights, scaling isn't as accurate because the queue length can't be used to inform scaling decisions. To learn more about setting rights in Service Bus access policies, see [Shared Access Authorization Policy](../service-bus-messaging/service-bus-sas.md#shared-access-authorization-policies). For Event Hub triggers, see the [this scaling guidance](#event-hubs-trigger).
3636

3737
## Limit scale out
3838

@@ -48,6 +48,27 @@ $resource.Properties.functionAppScaleLimit = <SCALE_LIMIT>
4848
$resource | Set-AzResource -Force
4949
```
5050

51+
## Event Hubs trigger
52+
53+
This section describes how scaling behaves when your function uses an [Event Hubs trigger](functions-bindings-event-hubs-trigger.md) or an [IoT Hub trigger](functions-bindings-event-iot-trigger.md). In these cases, each instance of an event triggered function is backed by a single [EventProcessorHost](/dotnet/api/microsoft.azure.eventhubs.processor) instance. The trigger (powered by Event Hubs) ensures that only one [EventProcessorHost](/dotnet/api/microsoft.azure.eventhubs.processor) instance can get a lease on a given partition.
54+
55+
For example, consider an Event Hub as follows:
56+
57+
* 10 partitions
58+
* 1,000 events distributed evenly across all partitions, with 100 messages in each partition
59+
60+
When your function is first enabled, there is only one instance of the function. Let's call the first function instance `Function_0`. The `Function_0` function has a single instance of [EventProcessorHost](/dotnet/api/microsoft.azure.eventhubs.processor) that holds a lease on all ten partitions. This instance is reading events from partitions 0-9. From this point forward, one of the following happens:
61+
62+
* **New function instances are not needed**: `Function_0` is able to process all 1,000 events before the Functions scaling logic take effect. In this case, all 1,000 messages are processed by `Function_0`.
63+
64+
* **An additional function instance is added**: If the Functions scaling logic determines that `Function_0` has more messages than it can process, a new function app instance (`Function_1`) is created. This new function also has an associated instance of [EventProcessorHost](/dotnet/api/microsoft.azure.eventhubs.processor). As the underlying Event Hubs detect that a new host instance is trying read messages, it load balances the partitions across the host instances. For example, partitions 0-4 may be assigned to `Function_0` and partitions 5-9 to `Function_1`.
65+
66+
* **N more function instances are added**: If the Functions scaling logic determines that both `Function_0` and `Function_1` have more messages than they can process, new `Functions_N` function app instances are created. Apps are created to the point where `N` is greater than the number of event hub partitions. In our example, Event Hubs again load balances the partitions, in this case across the instances `Function_0`...`Functions_9`.
67+
68+
As scaling occurs, `N` instances is a number greater than the number of event hub partitions. This pattern is used to ensure [EventProcessorHost](/dotnet/api/microsoft.azure.eventhubs.processor) instances are available to obtain locks on partitions as they become available from other instances. You are only charged for the resources used when the function instance executes. In other words, you are not charged for this over-provisioning.
69+
70+
When all function execution completes (with or without errors), checkpoints are added to the associated storage account. When check-pointing succeeds, all 1,000 messages are never retrieved again.
71+
5172
## Best practices and patterns for scalable apps
5273

5374
There are many aspects of a function app that impacts how it scales, including host configuration, runtime footprint, and resource efficiency. For more information, see the [scalability section of the performance considerations article](performance-reliability.md#scalability-best-practices). You should also be aware of how connections behave as your function app scales. For more information, see [How to manage connections in Azure Functions](manage-connections.md).

0 commit comments

Comments
 (0)