Skip to content
This repository was archived by the owner on Oct 14, 2023. It is now read-only.

Commit 64f8821

Browse files
author
Yoichi Kawasaki
committed
Added Dockerfile
1 parent e6ccb63 commit 64f8821

File tree

3 files changed

+37
-0
lines changed

3 files changed

+37
-0
lines changed

v2functions/Dockerfile

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
FROM mcr.microsoft.com/azure-functions/python:2.0
2+
3+
COPY . /home/site/wwwroot
4+
5+
RUN cd /home/site/wwwroot && \
6+
pip install -r requirements.txt
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import logging
2+
import json
3+
import azure.functions as func
4+
5+
def main(req: func.HttpRequest) -> func.HttpResponse:
6+
logging.info('Python HTTP trigger function processed a request.')
7+
return func.HttpResponse(
8+
json.dumps({
9+
'method': req.method,
10+
'url': req.url,
11+
'headers': dict(req.headers),
12+
'params': dict(req.params),
13+
'get_body': req.get_body().decode()
14+
})
15+
)
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"scriptFile": "__init__.py",
3+
"bindings": [
4+
{
5+
"authLevel": "anonymous",
6+
"type": "httpTrigger",
7+
"direction": "in",
8+
"name": "req"
9+
},
10+
{
11+
"type": "http",
12+
"direction": "out",
13+
"name": "$return"
14+
}
15+
]
16+
}

0 commit comments

Comments
 (0)