Skip to content

Commit 92c0070

Browse files
authored
Update Python dev reference for the same
1 parent b990575 commit 92c0070

File tree

1 file changed

+5
-9
lines changed

1 file changed

+5
-9
lines changed

articles/azure-functions/functions-reference-python.md

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,6 @@ You can also explicitly declare the attribute types and return type in the funct
8080
```python
8181
import azure.functions
8282

83-
8483
def main(req: azure.functions.HttpRequest) -> str:
8584
user = req.params.get('user')
8685
return f'Hello, {user}!'
@@ -97,7 +96,6 @@ Triggers and bindings can be declared and used in a function in a decorator base
9796
```python
9897
@app.function_name(name="HttpTrigger1")
9998
@app.route(route="req")
100-
10199
def main(req):
102100
user = req.params.get('user')
103101
return f'Hello, {user}!'
@@ -108,9 +106,10 @@ You can also explicitly declare the attribute types and return type in the funct
108106
```python
109107
import azure.functions
110108

109+
app = func.FunctionApp()
110+
111111
@app.function_name(name="HttpTrigger1")
112112
@app.route(route="req")
113-
114113
def main(req: azure.functions.HttpRequest) -> str:
115114
user = req.params.get('user')
116115
return f'Hello, {user}!'
@@ -392,7 +391,6 @@ app = func.FunctionApp()
392391

393392
@app.route(route="req")
394393
@app.read_blob(arg_name="obj", path="samples/{id}", connection="AzureWebJobsStorage")
395-
396394
def main(req: func.HttpRequest,
397395
obj: func.InputStream):
398396
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
478476
# function_app.py
479477
import azure.functions as func
480478

479+
app = func.FunctionApp()
481480

482481
@app.write_blob(arg_name="msg", path="output-container/{name}",
483482
connection="AzureWebJobsStorage")
484-
485483
def test_function(req: func.HttpRequest,
486484
msg: func.Out[str]) -> str:
487485

@@ -500,7 +498,6 @@ The following example logs an info message when the function is invoked via an H
500498
```python
501499
import logging
502500

503-
504501
def main(req):
505502
logging.info('Python HTTP trigger function processed a request.')
506503
```
@@ -617,7 +614,6 @@ The following example is from the HTTP trigger template for the Python v2 progra
617614
```python
618615
@app.function_name(name="HttpTrigger1")
619616
@app.route(route="hello")
620-
621617
def test_function(req: func.HttpRequest) -> func.HttpResponse:
622618
logging.info('Python HTTP trigger function processed a request.')
623619

@@ -915,9 +911,10 @@ import logging
915911
import os
916912
import azure.functions as func
917913

914+
app = func.FunctionApp()
915+
918916
@app.function_name(name="HttpTrigger1")
919917
@app.route(route="req")
920-
921918
def main(req: func.HttpRequest) -> func.HttpResponse:
922919

923920

@@ -1157,7 +1154,6 @@ from shared_code import my_second_helper_function
11571154

11581155
app = func.FunctionApp()
11591156

1160-
11611157
# Define the HTTP trigger that accepts the ?value=<int> query parameter
11621158
# Double the value and return the result in HttpResponse
11631159
@app.function_name(name="my_second_function")

0 commit comments

Comments
 (0)