Skip to content

Commit 7266efd

Browse files
committed
specify allowed types for bindings
1 parent 1f20bec commit 7266efd

5 files changed

+16
-2
lines changed

articles/azure-functions/functions-bindings-cosmosdb-v2-output.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -705,6 +705,12 @@ By default, when you write to the output parameter in your function, a document
705705
> [!NOTE]
706706
> When you specify the ID of an existing document, it gets overwritten by the new output document.
707707
708+
::: zone pivot="programming-language-python"
709+
710+
The output function parameter must be defined as `func.Out[func.Document]`. Refer to the [output example](#example) for details.
711+
712+
::: zone-end
713+
708714
::: zone pivot="programming-language-csharp"
709715

710716
The parameter type supported by the Cosmos DB output binding depends on the Functions runtime version, the extension package version, and the C# modality used.

articles/azure-functions/functions-bindings-event-grid-output.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -693,6 +693,9 @@ There are two options for outputting an Event Grid message from a function:
693693
- **Return value**: Set the `name` property in *function.json* to `$return`. With this configuration, the function's return value is persisted as an Event Grid message.
694694
- **Imperative**: Pass a value to the [set](/python/api/azure-functions/azure.functions.out#set-val--t-----none) method of the parameter declared as an [Out](/python/api/azure-functions/azure.functions.out) type. The value passed to `set` is persisted as an Event Grid message.
695695

696+
697+
The output function parameter must be defined as `func.Out[str]`, `func.Out[bytes]`, `func.Out[func.EventGridOutputEvent]`, or `func.Out[List[func.EventGridOutputEvent]]`. Refer to the [output example](#example) for details.
698+
696699
::: zone-end
697700

698701
## Connections

articles/azure-functions/functions-bindings-event-hubs-output.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -458,6 +458,8 @@ There are two options for outputting an Event Hubs message from a function:
458458

459459
- **Imperative**: Pass a value to the [set](/python/api/azure-functions/azure.functions.out#set-val--t-----none) method of the parameter declared as an [Out](/python/api/azure-functions/azure.functions.out) type. The value passed to `set` is persisted as an Event Hubs message.
460460

461+
The output function parameter must be defined as `func.Out[func.EventHubEvent]` or `func.Out[List[func.EventHubEvent]]`. Refer to the [output example](#example) for details.
462+
461463
::: zone-end
462464

463465
[!INCLUDE [functions-event-hubs-connections](../../includes/functions-event-hubs-connections.md)]

articles/azure-functions/functions-bindings-service-bus-output.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -622,8 +622,9 @@ Access the output message by using `context.bindings.<name>` where `<name>` is t
622622
::: zone pivot="programming-language-powershell"
623623
Output to the Service Bus is available via the `Push-OutputBinding` cmdlet where you pass arguments that match the name designated by binding's name parameter in the *function.json* file.
624624
::: zone-end
625-
::: zone pivot="programming-language-python"
626-
Use the [Azure Service Bus SDK](../service-bus-messaging/index.yml) rather than the built-in output binding.
625+
::: zone pivot="programming-language-python"
626+
The output function parameter must be defined as `func.Out[str]` or `func.Out[bytes]`. Refer to the [output example](#example) for details.
627+
Alternatively, you can use the [Azure Service Bus SDK](../service-bus-messaging/index.yml) rather than the built-in output binding.
627628
::: zone-end
628629
For a complete example, see [the examples section](#example).
629630

articles/azure-functions/functions-bindings-storage-queue-output.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -594,6 +594,8 @@ There are two options for writing from your function to the configured queue:
594594

595595
- **Imperative**: Pass a value to the [set](/python/api/azure-functions/azure.functions.out#set-val--t-----none) method of the parameter declared as an [Out](/python/api/azure-functions/azure.functions.out) type. The value passed to `set` is persisted as a Queue storage message.
596596

597+
The output function parameter must be defined as `func.Out[func.QueueMessage]`, `func.Out[str]`, or `func.Out[bytes]`. Refer to the [output example](#example) for details.
598+
597599
::: zone-end
598600

599601
[!INCLUDE [functions-storage-queue-connections](../../includes/functions-storage-queue-connections.md)]

0 commit comments

Comments
 (0)