From 886fc3135697579a2c5b322e6f15aaeff6590b27 Mon Sep 17 00:00:00 2001 From: Gohar Irfan Chaudhry Date: Fri, 12 Mar 2021 12:53:36 -0800 Subject: [PATCH 1/4] Added functions that take blob as input/output --- .../function.json | 23 +++++++ SyncGetBlobAsBytesReturnHttpResponse/main.py | 30 +++++++++ .../function.json | 23 +++++++ .../main.py | 30 +++++++++ .../function.json | 23 +++++++ SyncGetBlobAsStrReturnHttpResponse/main.py | 31 +++++++++ .../function.json | 23 +++++++ SyncPutBlobAsBytesReturnHttpResponse/main.py | 41 ++++++++++++ .../function.json | 23 +++++++ SyncPutBlobAsStrReturnHttpResponse/main.py | 39 ++++++++++++ .../function.json | 47 ++++++++++++++ .../main.py | 63 +++++++++++++++++++ 12 files changed, 396 insertions(+) create mode 100644 SyncGetBlobAsBytesReturnHttpResponse/function.json create mode 100644 SyncGetBlobAsBytesReturnHttpResponse/main.py create mode 100644 SyncGetBlobAsBytesStreamReturnHttpResponse/function.json create mode 100644 SyncGetBlobAsBytesStreamReturnHttpResponse/main.py create mode 100644 SyncGetBlobAsStrReturnHttpResponse/function.json create mode 100644 SyncGetBlobAsStrReturnHttpResponse/main.py create mode 100644 SyncPutBlobAsBytesReturnHttpResponse/function.json create mode 100644 SyncPutBlobAsBytesReturnHttpResponse/main.py create mode 100644 SyncPutBlobAsStrReturnHttpResponse/function.json create mode 100644 SyncPutBlobAsStrReturnHttpResponse/main.py create mode 100644 SyncPutGetMultipleBlobsAsBytesReturnHttpResponse/function.json create mode 100644 SyncPutGetMultipleBlobsAsBytesReturnHttpResponse/main.py diff --git a/SyncGetBlobAsBytesReturnHttpResponse/function.json b/SyncGetBlobAsBytesReturnHttpResponse/function.json new file mode 100644 index 0000000..cc19d21 --- /dev/null +++ b/SyncGetBlobAsBytesReturnHttpResponse/function.json @@ -0,0 +1,23 @@ +{ + "scriptFile": "main.py", + "bindings": [ + { + "type": "httpTrigger", + "direction": "in", + "name": "req" + }, + { + "type": "blob", + "direction": "in", + "name": "file", + "dataType": "binary", + "connection": "AzureWebJobsStorage", + "path": "python-worker-perf-tests/shmem-test-bytes.txt" + }, + { + "type": "http", + "direction": "out", + "name": "$return" + } + ] +} diff --git a/SyncGetBlobAsBytesReturnHttpResponse/main.py b/SyncGetBlobAsBytesReturnHttpResponse/main.py new file mode 100644 index 0000000..a10faca --- /dev/null +++ b/SyncGetBlobAsBytesReturnHttpResponse/main.py @@ -0,0 +1,30 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. + +import json +import hashlib +import azure.functions as azf + + +def main(req: azf.HttpRequest, file: bytes) -> azf.HttpResponse: + """ + Read a blob (bytes) and respond back (in HTTP response) with the number of + bytes read and the MD5 digest of the content. + """ + assert isinstance(file, bytes) + + content_size = len(file) + content_md5 = hashlib.md5(file).hexdigest() + + response_dict = { + 'content_size': content_size, + 'content_md5': content_md5 + } + + response_body = json.dumps(response_dict, indent=2) + + return azf.HttpResponse( + body=response_body, + mimetype="application/json", + status_code=200 + ) diff --git a/SyncGetBlobAsBytesStreamReturnHttpResponse/function.json b/SyncGetBlobAsBytesStreamReturnHttpResponse/function.json new file mode 100644 index 0000000..cc19d21 --- /dev/null +++ b/SyncGetBlobAsBytesStreamReturnHttpResponse/function.json @@ -0,0 +1,23 @@ +{ + "scriptFile": "main.py", + "bindings": [ + { + "type": "httpTrigger", + "direction": "in", + "name": "req" + }, + { + "type": "blob", + "direction": "in", + "name": "file", + "dataType": "binary", + "connection": "AzureWebJobsStorage", + "path": "python-worker-perf-tests/shmem-test-bytes.txt" + }, + { + "type": "http", + "direction": "out", + "name": "$return" + } + ] +} diff --git a/SyncGetBlobAsBytesStreamReturnHttpResponse/main.py b/SyncGetBlobAsBytesStreamReturnHttpResponse/main.py new file mode 100644 index 0000000..6b49a94 --- /dev/null +++ b/SyncGetBlobAsBytesStreamReturnHttpResponse/main.py @@ -0,0 +1,30 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. + +import json +import hashlib +import azure.functions as azf + + +def main(req: azf.HttpRequest, file: azf.InputStream) -> azf.HttpResponse: + """ + Read a blob (as azf.InputStream) and respond back (in HTTP response) with + the number of bytes read and the MD5 digest of the content. + """ + file_bytes = file.read() + + content_size = len(file_bytes) + content_md5 = hashlib.md5(file_bytes).hexdigest() + + response_dict = { + 'content_size': content_size, + 'content_md5': content_md5 + } + + response_body = json.dumps(response_dict, indent=2) + + return azf.HttpResponse( + body=response_body, + mimetype="application/json", + status_code=200 + ) diff --git a/SyncGetBlobAsStrReturnHttpResponse/function.json b/SyncGetBlobAsStrReturnHttpResponse/function.json new file mode 100644 index 0000000..af6324d --- /dev/null +++ b/SyncGetBlobAsStrReturnHttpResponse/function.json @@ -0,0 +1,23 @@ +{ + "scriptFile": "main.py", + "bindings": [ + { + "type": "httpTrigger", + "direction": "in", + "name": "req" + }, + { + "type": "blob", + "direction": "in", + "name": "file", + "dataType": "string", + "connection": "AzureWebJobsStorage", + "path": "python-worker-perf-tests/shmem-test-str.txt" + }, + { + "type": "http", + "direction": "out", + "name": "$return" + } + ] +} diff --git a/SyncGetBlobAsStrReturnHttpResponse/main.py b/SyncGetBlobAsStrReturnHttpResponse/main.py new file mode 100644 index 0000000..0e03f7d --- /dev/null +++ b/SyncGetBlobAsStrReturnHttpResponse/main.py @@ -0,0 +1,31 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. + +import json +import hashlib +import azure.functions as azf + + +def main(req: azf.HttpRequest, file: str) -> azf.HttpResponse: + """ + Read a blob (string) and respond back (in HTTP response) with the number of + characters read and the MD5 digest of the utf-8 encoded content. + """ + assert isinstance(file, str) + + num_chars = len(file) + content_bytes = file.encode('utf-8') + content_md5 = hashlib.md5(content_bytes).hexdigest() + + response_dict = { + 'num_chars': num_chars, + 'content_md5': content_md5 + } + + response_body = json.dumps(response_dict, indent=2) + + return azf.HttpResponse( + body=response_body, + mimetype="application/json", + status_code=200 + ) diff --git a/SyncPutBlobAsBytesReturnHttpResponse/function.json b/SyncPutBlobAsBytesReturnHttpResponse/function.json new file mode 100644 index 0000000..2448970 --- /dev/null +++ b/SyncPutBlobAsBytesReturnHttpResponse/function.json @@ -0,0 +1,23 @@ +{ + "scriptFile": "main.py", + "bindings": [ + { + "type": "httpTrigger", + "direction": "in", + "name": "req" + }, + { + "type": "blob", + "direction": "out", + "name": "file", + "dataType": "binary", + "connection": "AzureWebJobsStorage", + "path": "python-worker-perf-tests/shmem-test-bytes-out.txt" + }, + { + "type": "http", + "direction": "out", + "name": "$return" + } + ] +} diff --git a/SyncPutBlobAsBytesReturnHttpResponse/main.py b/SyncPutBlobAsBytesReturnHttpResponse/main.py new file mode 100644 index 0000000..e6e7109 --- /dev/null +++ b/SyncPutBlobAsBytesReturnHttpResponse/main.py @@ -0,0 +1,41 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. + +import random +import json +import hashlib +import azure.functions as azf + + +def main(req: azf.HttpRequest, file: azf.Out[bytes]) -> azf.HttpResponse: + """ + Write a blob (bytes) and respond back (in HTTP response) with the number of + bytes written and the MD5 digest of the content. + The number of bytes to write are specified in the input HTTP request. + """ + content_size = int(req.params['content_size']) + + # When this is set, then 0x01 byte is repeated content_size number of + # times to use as input. + # This is to avoid generating random input for large size which can be + # slow. + if 'no_random_input' in req.params: + content = b'\x01' * content_size + else: + content = bytearray(random.getrandbits(8) for _ in range(content_size)) + content_md5 = hashlib.md5(content).hexdigest() + + file.set(content) + + response_dict = { + 'content_size': content_size, + 'content_md5': content_md5 + } + + response_body = json.dumps(response_dict, indent=2) + + return azf.HttpResponse( + body=response_body, + mimetype="application/json", + status_code=200 + ) diff --git a/SyncPutBlobAsStrReturnHttpResponse/function.json b/SyncPutBlobAsStrReturnHttpResponse/function.json new file mode 100644 index 0000000..cf1c7b5 --- /dev/null +++ b/SyncPutBlobAsStrReturnHttpResponse/function.json @@ -0,0 +1,23 @@ +{ + "scriptFile": "main.py", + "bindings": [ + { + "type": "httpTrigger", + "direction": "in", + "name": "req" + }, + { + "type": "blob", + "direction": "out", + "name": "file", + "dataType": "string", + "connection": "AzureWebJobsStorage", + "path": "python-worker-perf-tests/shmem-test-str-out.txt" + }, + { + "type": "http", + "direction": "out", + "name": "$return" + } + ] +} diff --git a/SyncPutBlobAsStrReturnHttpResponse/main.py b/SyncPutBlobAsStrReturnHttpResponse/main.py new file mode 100644 index 0000000..901a7f3 --- /dev/null +++ b/SyncPutBlobAsStrReturnHttpResponse/main.py @@ -0,0 +1,39 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. + +import string +import random +import json +import hashlib +import azure.functions as azf + + +def main(req: azf.HttpRequest, file: azf.Out[str]) -> azf.HttpResponse: + """ + Write a blob (string) and respond back (in HTTP response) with the number of + characters written and the MD5 digest of the utf-8 encoded content. + The number of characters to write are specified in the input HTTP request. + """ + num_chars = int(req.params['num_chars']) + + content = ''.join(random.choices(string.ascii_uppercase + string.digits, + k=num_chars)) + content_bytes = content.encode('utf-8') + content_size = len(content_bytes) + content_md5 = hashlib.md5(content_bytes).hexdigest() + + file.set(content) + + response_dict = { + 'num_chars': num_chars, + 'content_size': content_size, + 'content_md5': content_md5 + } + + response_body = json.dumps(response_dict, indent=2) + + return azf.HttpResponse( + body=response_body, + mimetype="application/json", + status_code=200 + ) diff --git a/SyncPutGetMultipleBlobsAsBytesReturnHttpResponse/function.json b/SyncPutGetMultipleBlobsAsBytesReturnHttpResponse/function.json new file mode 100644 index 0000000..a3cd34f --- /dev/null +++ b/SyncPutGetMultipleBlobsAsBytesReturnHttpResponse/function.json @@ -0,0 +1,47 @@ +{ + "scriptFile": "main.py", + "bindings": [ + { + "type": "httpTrigger", + "direction": "in", + "name": "req" + }, + { + "type": "blob", + "direction": "in", + "name": "inputfile1", + "dataType": "binary", + "connection": "AzureWebJobsStorage", + "path": "python-worker-perf-tests/shmem-test-bytes-1.txt" + }, + { + "type": "blob", + "direction": "in", + "name": "inputfile2", + "dataType": "binary", + "connection": "AzureWebJobsStorage", + "path": "python-worker-perf-tests/shmem-test-bytes-2.txt" + }, + { + "type": "blob", + "direction": "out", + "name": "outputfile1", + "dataType": "binary", + "connection": "AzureWebJobsStorage", + "path": "python-worker-perf-tests/shmem-test-bytes-out-1.txt" + }, + { + "type": "blob", + "direction": "out", + "name": "outputfile2", + "dataType": "binary", + "connection": "AzureWebJobsStorage", + "path": "python-worker-perf-tests/shmem-test-bytes-out-2.txt" + }, + { + "type": "http", + "direction": "out", + "name": "$return" + } + ] +} diff --git a/SyncPutGetMultipleBlobsAsBytesReturnHttpResponse/main.py b/SyncPutGetMultipleBlobsAsBytesReturnHttpResponse/main.py new file mode 100644 index 0000000..abb87fb --- /dev/null +++ b/SyncPutGetMultipleBlobsAsBytesReturnHttpResponse/main.py @@ -0,0 +1,63 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. + +import random +import json +import hashlib +import azure.functions as azf + + +def _generate_content_and_digest(content_size): + content = bytearray(random.getrandbits(8) for _ in range(content_size)) + content_md5 = hashlib.md5(content).hexdigest() + return content, content_md5 + + +def main( + req: azf.HttpRequest, + inputfile1: bytes, + inputfile2: bytes, + outputfile1: azf.Out[bytes], + outputfile2: azf.Out[bytes]) -> azf.HttpResponse: + """ + Read two blobs (bytes) and respond back (in HTTP response) with the number + of bytes read from each blob and the MD5 digest of the content of each. + Write two blobs (bytes) and respond back (in HTTP response) with the number + bytes written in each blob and the MD5 digest of the content of each. + The number of bytes to write are specified in the input HTTP request. + """ + input_content_size_1 = len(inputfile1) + input_content_size_2 = len(inputfile2) + + input_content_md5_1 = hashlib.md5(inputfile1).hexdigest() + input_content_md5_2 = hashlib.md5(inputfile2).hexdigest() + + output_content_size_1 = int(req.params['output_content_size_1']) + output_content_size_2 = int(req.params['output_content_size_2']) + + output_content_1, output_content_md5_1 = \ + _generate_content_and_digest(output_content_size_1) + output_content_2, output_content_md5_2 = \ + _generate_content_and_digest(output_content_size_2) + + outputfile1.set(output_content_1) + outputfile2.set(output_content_2) + + response_dict = { + 'input_content_size_1': input_content_size_1, + 'input_content_size_2': input_content_size_2, + 'input_content_md5_1': input_content_md5_1, + 'input_content_md5_2': input_content_md5_2, + 'output_content_size_1': output_content_size_1, + 'output_content_size_2': output_content_size_2, + 'output_content_md5_1': output_content_md5_1, + 'output_content_md5_2': output_content_md5_2 + } + + response_body = json.dumps(response_dict, indent=2) + + return azf.HttpResponse( + body=response_body, + mimetype="application/json", + status_code=200 + ) From ced02b2b5fde647fdda3ba1d1c1a614613df33e5 Mon Sep 17 00:00:00 2001 From: Gohar Irfan Chaudhry Date: Fri, 12 Mar 2021 13:44:11 -0800 Subject: [PATCH 2/4] Passing filenames in the request --- SyncGetBlobAsBytesReturnHttpResponse/function.json | 2 +- SyncGetBlobAsBytesStreamReturnHttpResponse/function.json | 2 +- SyncGetBlobAsStrReturnHttpResponse/function.json | 2 +- SyncPutBlobAsBytesReturnHttpResponse/function.json | 2 +- SyncPutBlobAsStrReturnHttpResponse/function.json | 2 +- .../function.json | 8 ++++---- 6 files changed, 9 insertions(+), 9 deletions(-) diff --git a/SyncGetBlobAsBytesReturnHttpResponse/function.json b/SyncGetBlobAsBytesReturnHttpResponse/function.json index cc19d21..c47f30d 100644 --- a/SyncGetBlobAsBytesReturnHttpResponse/function.json +++ b/SyncGetBlobAsBytesReturnHttpResponse/function.json @@ -12,7 +12,7 @@ "name": "file", "dataType": "binary", "connection": "AzureWebJobsStorage", - "path": "python-worker-perf-tests/shmem-test-bytes.txt" + "path": "python-worker-perf-tests/{infile}" }, { "type": "http", diff --git a/SyncGetBlobAsBytesStreamReturnHttpResponse/function.json b/SyncGetBlobAsBytesStreamReturnHttpResponse/function.json index cc19d21..c47f30d 100644 --- a/SyncGetBlobAsBytesStreamReturnHttpResponse/function.json +++ b/SyncGetBlobAsBytesStreamReturnHttpResponse/function.json @@ -12,7 +12,7 @@ "name": "file", "dataType": "binary", "connection": "AzureWebJobsStorage", - "path": "python-worker-perf-tests/shmem-test-bytes.txt" + "path": "python-worker-perf-tests/{infile}" }, { "type": "http", diff --git a/SyncGetBlobAsStrReturnHttpResponse/function.json b/SyncGetBlobAsStrReturnHttpResponse/function.json index af6324d..c1bfc43 100644 --- a/SyncGetBlobAsStrReturnHttpResponse/function.json +++ b/SyncGetBlobAsStrReturnHttpResponse/function.json @@ -12,7 +12,7 @@ "name": "file", "dataType": "string", "connection": "AzureWebJobsStorage", - "path": "python-worker-perf-tests/shmem-test-str.txt" + "path": "python-worker-perf-tests/{infile}" }, { "type": "http", diff --git a/SyncPutBlobAsBytesReturnHttpResponse/function.json b/SyncPutBlobAsBytesReturnHttpResponse/function.json index 2448970..01115a0 100644 --- a/SyncPutBlobAsBytesReturnHttpResponse/function.json +++ b/SyncPutBlobAsBytesReturnHttpResponse/function.json @@ -12,7 +12,7 @@ "name": "file", "dataType": "binary", "connection": "AzureWebJobsStorage", - "path": "python-worker-perf-tests/shmem-test-bytes-out.txt" + "path": "python-worker-perf-tests/{outfile}" }, { "type": "http", diff --git a/SyncPutBlobAsStrReturnHttpResponse/function.json b/SyncPutBlobAsStrReturnHttpResponse/function.json index cf1c7b5..0d9d8b4 100644 --- a/SyncPutBlobAsStrReturnHttpResponse/function.json +++ b/SyncPutBlobAsStrReturnHttpResponse/function.json @@ -12,7 +12,7 @@ "name": "file", "dataType": "string", "connection": "AzureWebJobsStorage", - "path": "python-worker-perf-tests/shmem-test-str-out.txt" + "path": "python-worker-perf-tests/{outfile}" }, { "type": "http", diff --git a/SyncPutGetMultipleBlobsAsBytesReturnHttpResponse/function.json b/SyncPutGetMultipleBlobsAsBytesReturnHttpResponse/function.json index a3cd34f..54ff44d 100644 --- a/SyncPutGetMultipleBlobsAsBytesReturnHttpResponse/function.json +++ b/SyncPutGetMultipleBlobsAsBytesReturnHttpResponse/function.json @@ -12,7 +12,7 @@ "name": "inputfile1", "dataType": "binary", "connection": "AzureWebJobsStorage", - "path": "python-worker-perf-tests/shmem-test-bytes-1.txt" + "path": "python-worker-perf-tests/{infile1}" }, { "type": "blob", @@ -20,7 +20,7 @@ "name": "inputfile2", "dataType": "binary", "connection": "AzureWebJobsStorage", - "path": "python-worker-perf-tests/shmem-test-bytes-2.txt" + "path": "python-worker-perf-tests/{infile2}" }, { "type": "blob", @@ -28,7 +28,7 @@ "name": "outputfile1", "dataType": "binary", "connection": "AzureWebJobsStorage", - "path": "python-worker-perf-tests/shmem-test-bytes-out-1.txt" + "path": "python-worker-perf-tests/{outfile1}" }, { "type": "blob", @@ -36,7 +36,7 @@ "name": "outputfile2", "dataType": "binary", "connection": "AzureWebJobsStorage", - "path": "python-worker-perf-tests/shmem-test-bytes-out-2.txt" + "path": "python-worker-perf-tests/{outfile2}" }, { "type": "http", From 42d356fea7061f731b9db6902449789dbf2cea45 Mon Sep 17 00:00:00 2001 From: Gohar Irfan Chaudhry Date: Fri, 12 Mar 2021 16:34:52 -0800 Subject: [PATCH 3/4] Setting authentication to anonymous for blob functions --- SyncGetBlobAsBytesReturnHttpResponse/function.json | 1 + SyncGetBlobAsBytesStreamReturnHttpResponse/function.json | 1 + SyncGetBlobAsStrReturnHttpResponse/function.json | 1 + SyncPutBlobAsBytesReturnHttpResponse/function.json | 1 + SyncPutBlobAsStrReturnHttpResponse/function.json | 1 + SyncPutGetMultipleBlobsAsBytesReturnHttpResponse/function.json | 1 + 6 files changed, 6 insertions(+) diff --git a/SyncGetBlobAsBytesReturnHttpResponse/function.json b/SyncGetBlobAsBytesReturnHttpResponse/function.json index c47f30d..cbe71a0 100644 --- a/SyncGetBlobAsBytesReturnHttpResponse/function.json +++ b/SyncGetBlobAsBytesReturnHttpResponse/function.json @@ -2,6 +2,7 @@ "scriptFile": "main.py", "bindings": [ { + "authLevel": "anonymous", "type": "httpTrigger", "direction": "in", "name": "req" diff --git a/SyncGetBlobAsBytesStreamReturnHttpResponse/function.json b/SyncGetBlobAsBytesStreamReturnHttpResponse/function.json index c47f30d..cbe71a0 100644 --- a/SyncGetBlobAsBytesStreamReturnHttpResponse/function.json +++ b/SyncGetBlobAsBytesStreamReturnHttpResponse/function.json @@ -2,6 +2,7 @@ "scriptFile": "main.py", "bindings": [ { + "authLevel": "anonymous", "type": "httpTrigger", "direction": "in", "name": "req" diff --git a/SyncGetBlobAsStrReturnHttpResponse/function.json b/SyncGetBlobAsStrReturnHttpResponse/function.json index c1bfc43..5df58b7 100644 --- a/SyncGetBlobAsStrReturnHttpResponse/function.json +++ b/SyncGetBlobAsStrReturnHttpResponse/function.json @@ -2,6 +2,7 @@ "scriptFile": "main.py", "bindings": [ { + "authLevel": "anonymous", "type": "httpTrigger", "direction": "in", "name": "req" diff --git a/SyncPutBlobAsBytesReturnHttpResponse/function.json b/SyncPutBlobAsBytesReturnHttpResponse/function.json index 01115a0..ae4b217 100644 --- a/SyncPutBlobAsBytesReturnHttpResponse/function.json +++ b/SyncPutBlobAsBytesReturnHttpResponse/function.json @@ -2,6 +2,7 @@ "scriptFile": "main.py", "bindings": [ { + "authLevel": "anonymous", "type": "httpTrigger", "direction": "in", "name": "req" diff --git a/SyncPutBlobAsStrReturnHttpResponse/function.json b/SyncPutBlobAsStrReturnHttpResponse/function.json index 0d9d8b4..7bb75b8 100644 --- a/SyncPutBlobAsStrReturnHttpResponse/function.json +++ b/SyncPutBlobAsStrReturnHttpResponse/function.json @@ -2,6 +2,7 @@ "scriptFile": "main.py", "bindings": [ { + "authLevel": "anonymous", "type": "httpTrigger", "direction": "in", "name": "req" diff --git a/SyncPutGetMultipleBlobsAsBytesReturnHttpResponse/function.json b/SyncPutGetMultipleBlobsAsBytesReturnHttpResponse/function.json index 54ff44d..866fd94 100644 --- a/SyncPutGetMultipleBlobsAsBytesReturnHttpResponse/function.json +++ b/SyncPutGetMultipleBlobsAsBytesReturnHttpResponse/function.json @@ -2,6 +2,7 @@ "scriptFile": "main.py", "bindings": [ { + "authLevel": "anonymous", "type": "httpTrigger", "direction": "in", "name": "req" From 7b4c01d54f4bfc972a6b690f3e19e5e9286d089c Mon Sep 17 00:00:00 2001 From: Gohar Irfan Chaudhry Date: Fri, 12 Mar 2021 16:40:04 -0800 Subject: [PATCH 4/4] Setting GET/POST methods for blob functions --- SyncGetBlobAsBytesReturnHttpResponse/function.json | 6 +++++- SyncGetBlobAsBytesStreamReturnHttpResponse/function.json | 6 +++++- SyncGetBlobAsStrReturnHttpResponse/function.json | 6 +++++- SyncPutBlobAsBytesReturnHttpResponse/function.json | 6 +++++- SyncPutBlobAsStrReturnHttpResponse/function.json | 6 +++++- .../function.json | 6 +++++- 6 files changed, 30 insertions(+), 6 deletions(-) diff --git a/SyncGetBlobAsBytesReturnHttpResponse/function.json b/SyncGetBlobAsBytesReturnHttpResponse/function.json index cbe71a0..90f1ffa 100644 --- a/SyncGetBlobAsBytesReturnHttpResponse/function.json +++ b/SyncGetBlobAsBytesReturnHttpResponse/function.json @@ -5,7 +5,11 @@ "authLevel": "anonymous", "type": "httpTrigger", "direction": "in", - "name": "req" + "name": "req", + "methods": [ + "get", + "post" + ] }, { "type": "blob", diff --git a/SyncGetBlobAsBytesStreamReturnHttpResponse/function.json b/SyncGetBlobAsBytesStreamReturnHttpResponse/function.json index cbe71a0..90f1ffa 100644 --- a/SyncGetBlobAsBytesStreamReturnHttpResponse/function.json +++ b/SyncGetBlobAsBytesStreamReturnHttpResponse/function.json @@ -5,7 +5,11 @@ "authLevel": "anonymous", "type": "httpTrigger", "direction": "in", - "name": "req" + "name": "req", + "methods": [ + "get", + "post" + ] }, { "type": "blob", diff --git a/SyncGetBlobAsStrReturnHttpResponse/function.json b/SyncGetBlobAsStrReturnHttpResponse/function.json index 5df58b7..f6f7258 100644 --- a/SyncGetBlobAsStrReturnHttpResponse/function.json +++ b/SyncGetBlobAsStrReturnHttpResponse/function.json @@ -5,7 +5,11 @@ "authLevel": "anonymous", "type": "httpTrigger", "direction": "in", - "name": "req" + "name": "req", + "methods": [ + "get", + "post" + ] }, { "type": "blob", diff --git a/SyncPutBlobAsBytesReturnHttpResponse/function.json b/SyncPutBlobAsBytesReturnHttpResponse/function.json index ae4b217..160142c 100644 --- a/SyncPutBlobAsBytesReturnHttpResponse/function.json +++ b/SyncPutBlobAsBytesReturnHttpResponse/function.json @@ -5,7 +5,11 @@ "authLevel": "anonymous", "type": "httpTrigger", "direction": "in", - "name": "req" + "name": "req", + "methods": [ + "get", + "post" + ] }, { "type": "blob", diff --git a/SyncPutBlobAsStrReturnHttpResponse/function.json b/SyncPutBlobAsStrReturnHttpResponse/function.json index 7bb75b8..207b2e6 100644 --- a/SyncPutBlobAsStrReturnHttpResponse/function.json +++ b/SyncPutBlobAsStrReturnHttpResponse/function.json @@ -5,7 +5,11 @@ "authLevel": "anonymous", "type": "httpTrigger", "direction": "in", - "name": "req" + "name": "req", + "methods": [ + "get", + "post" + ] }, { "type": "blob", diff --git a/SyncPutGetMultipleBlobsAsBytesReturnHttpResponse/function.json b/SyncPutGetMultipleBlobsAsBytesReturnHttpResponse/function.json index 866fd94..a4b251c 100644 --- a/SyncPutGetMultipleBlobsAsBytesReturnHttpResponse/function.json +++ b/SyncPutGetMultipleBlobsAsBytesReturnHttpResponse/function.json @@ -5,7 +5,11 @@ "authLevel": "anonymous", "type": "httpTrigger", "direction": "in", - "name": "req" + "name": "req", + "methods": [ + "get", + "post" + ] }, { "type": "blob",