Skip to content

Commit 6a5cb71

Browse files
committed
Add to webhook trigger.
1 parent 827682e commit 6a5cb71

File tree

1 file changed

+48
-1
lines changed

1 file changed

+48
-1
lines changed

articles/azure-functions/functions-bindings-http-webhook-trigger.md

Lines changed: 48 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -780,7 +780,7 @@ public class HttpTriggerJava {
780780
```
781781

782782
::: zone-end
783-
::: zone pivot="programming-language-javascript,programming-language-python,programming-language-powershell"
783+
::: zone pivot="programming-language-javascript,programming-language-powershell"
784784

785785
As an example, the following *function.json* file defines a `route` property for an HTTP trigger with two parameters, `category` and `id`:
786786

@@ -803,6 +803,43 @@ As an example, the following *function.json* file defines a `route` property for
803803
}
804804
```
805805

806+
::: zone-end
807+
::: zone pivot="programming-language-python"
808+
809+
As an example, the following code defines a `route` property for an HTTP trigger with two parameters, `category` and `id`:
810+
811+
# [v2](#tab/python-v2)
812+
813+
```python
814+
@app.function_name(name="httpTrigger")
815+
@app.route(route="products/{category:alpha}/{id:int?}")
816+
```
817+
818+
# [v1](#tab/python-v1)
819+
820+
In the *function.json* file:
821+
822+
```json
823+
{
824+
"bindings": [
825+
{
826+
"type": "httpTrigger",
827+
"name": "req",
828+
"direction": "in",
829+
"methods": [ "get" ],
830+
"route": "products/{category:alpha}/{id:int?}"
831+
},
832+
{
833+
"type": "http",
834+
"name": "res",
835+
"direction": "out"
836+
}
837+
]
838+
}
839+
```
840+
841+
---
842+
806843
::: zone-end
807844
::: zone pivot="programming-language-javascript"
808845

@@ -885,6 +922,14 @@ Route parameters that defined a function's `route` pattern are available to each
885922

886923
The following configuration shows how the `{id}` parameter is passed to the binding's `rowKey`.
887924

925+
# [v2](#tab/python-v2)
926+
927+
```python
928+
@app.table_input(arg_name="product", table_name="products", row_key="{id}", partition_key="products" connection="AzureWebJobsStorage")
929+
```
930+
931+
# [v1](#tab/python-v1)
932+
888933
```json
889934
{
890935
"type": "table",
@@ -896,6 +941,8 @@ The following configuration shows how the `{id}` parameter is passed to the bind
896941
}
897942
```
898943

944+
---
945+
899946
When you use route parameters, an `invoke_URL_template` is automatically created for your function. Your clients can use the URL template to understand the parameters they need to pass in the URL when calling your function using its URL. Navigate to one of your HTTP-triggered functions in the [Azure portal](https://portal.azure.com) and select **Get function URL**.
900947

901948
You can programmatically access the `invoke_URL_template` by using the Azure Resource Manager APIs for [List Functions](/rest/api/appservice/webapps/listfunctions) or [Get Function](/rest/api/appservice/webapps/getfunction).

0 commit comments

Comments
 (0)