@@ -80,7 +80,6 @@ You can also explicitly declare the attribute types and return type in the funct
80
80
``` python
81
81
import azure.functions
82
82
83
-
84
83
def main (req : azure.functions.HttpRequest) -> str :
85
84
user = req.params.get(' user' )
86
85
return f ' Hello, { user} ! '
@@ -97,7 +96,6 @@ Triggers and bindings can be declared and used in a function in a decorator base
97
96
``` python
98
97
@app.function_name (name = " HttpTrigger1" )
99
98
@app.route (route = " req" )
100
-
101
99
def main (req ):
102
100
user = req.params.get(' user' )
103
101
return f ' Hello, { user} ! '
@@ -108,9 +106,10 @@ You can also explicitly declare the attribute types and return type in the funct
108
106
``` python
109
107
import azure.functions
110
108
109
+ app = func.FunctionApp()
110
+
111
111
@app.function_name (name = " HttpTrigger1" )
112
112
@app.route (route = " req" )
113
-
114
113
def main (req : azure.functions.HttpRequest) -> str :
115
114
user = req.params.get(' user' )
116
115
return f ' Hello, { user} ! '
@@ -392,7 +391,6 @@ app = func.FunctionApp()
392
391
393
392
@app.route (route = " req" )
394
393
@app.read_blob (arg_name = " obj" , path = " samples/{id} " , connection = " AzureWebJobsStorage" )
395
-
396
394
def main (req : func.HttpRequest,
397
395
obj : func.InputStream):
398
396
logging.info(f ' Python HTTP-triggered function processed: { obj.read()} ' )
@@ -478,10 +476,10 @@ To produce multiple outputs, use the `set()` method provided by the [`azure.func
478
476
# function_app.py
479
477
import azure.functions as func
480
478
479
+ app = func.FunctionApp()
481
480
482
481
@app.write_blob (arg_name = " msg" , path = " output-container/{name} " ,
483
482
connection = " AzureWebJobsStorage" )
484
-
485
483
def test_function (req : func.HttpRequest,
486
484
msg : func.Out[str ]) -> str :
487
485
@@ -500,7 +498,6 @@ The following example logs an info message when the function is invoked via an H
500
498
``` python
501
499
import logging
502
500
503
-
504
501
def main (req ):
505
502
logging.info(' Python HTTP trigger function processed a request.' )
506
503
```
@@ -617,7 +614,6 @@ The following example is from the HTTP trigger template for the Python v2 progra
617
614
``` python
618
615
@app.function_name (name = " HttpTrigger1" )
619
616
@app.route (route = " hello" )
620
-
621
617
def test_function (req : func.HttpRequest) -> func.HttpResponse:
622
618
logging.info(' Python HTTP trigger function processed a request.' )
623
619
@@ -915,9 +911,10 @@ import logging
915
911
import os
916
912
import azure.functions as func
917
913
914
+ app = func.FunctionApp()
915
+
918
916
@app.function_name (name = " HttpTrigger1" )
919
917
@app.route (route = " req" )
920
-
921
918
def main (req : func.HttpRequest) -> func.HttpResponse:
922
919
923
920
@@ -1157,7 +1154,6 @@ from shared_code import my_second_helper_function
1157
1154
1158
1155
app = func.FunctionApp()
1159
1156
1160
-
1161
1157
# Define the HTTP trigger that accepts the ?value=<int> query parameter
1162
1158
# Double the value and return the result in HttpResponse
1163
1159
@app.function_name (name = " my_second_function" )
0 commit comments