Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
hvalfangst committed Dec 25, 2023
1 parent 872afc8 commit de10eb3
Show file tree
Hide file tree
Showing 11 changed files with 93 additions and 46 deletions.
28 changes: 0 additions & 28 deletions FlaskApp/__init__.py

This file was deleted.

Empty file removed FlaskApp/package/__init__.py
Empty file.
1 change: 0 additions & 1 deletion FlaskApp/package/module.py

This file was deleted.

8 changes: 0 additions & 8 deletions __init__.py

This file was deleted.

6 changes: 0 additions & 6 deletions requirements.txt

This file was deleted.

48 changes: 48 additions & 0 deletions v2function/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
bin
obj
csx
.vs
edge
Publish

*.user
*.suo
*.cscfg
*.Cache
project.lock.json

/packages
/TestResults

/tools/NuGet.exe
/App_Data
/secrets
/data
.secrets
appsettings.json
local.settings.json

node_modules
dist

# Local python packages
.python_packages/

# Python Environments
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/

# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# Azurite artifacts
__blobstorage__
__queuestorage__
__azurite_db*__.json
24 changes: 24 additions & 0 deletions v2function/HvalfangstFunction/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import logging

import azure.functions as func


def main(req: func.HttpRequest) -> func.HttpResponse:
logging.info('Python HTTP trigger function processed a request.')

name = req.params.get('name')
if not name:
try:
req_body = req.get_json()
except ValueError:
pass
else:
name = req_body.get('name')

if name:
return func.HttpResponse(f"Hello, {name}. This HTTP triggered function executed successfully.")
else:
return func.HttpResponse(
"This HTTP triggered function executed successfully. Pass a name in the query string or in the request body for a personalized response.",
status_code=200
)
5 changes: 2 additions & 3 deletions function.json → v2function/HvalfangstFunction/function.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,14 @@
"scriptFile": "__init__.py",
"bindings": [
{
"authLevel": "anonymous",
"authLevel": "function",
"type": "httpTrigger",
"direction": "in",
"name": "req",
"methods": [
"get",
"post"
],
"route": "/{*route}"
]
},
{
"type": "http",
Expand Down
6 changes: 6 additions & 0 deletions v2function/function_app.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import azure.functions as func
import datetime
import json
import logging

app = func.FunctionApp()
8 changes: 8 additions & 0 deletions v2function/local.settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"IsEncrypted": false,
"Values": {
"FUNCTIONS_WORKER_RUNTIME": "python",
"AzureWebJobsFeatureFlags": "EnableWorkerIndexing",
"AzureWebJobsStorage": "UseDevelopmentStorage=true"
}
}
5 changes: 5 additions & 0 deletions v2function/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Do not include azure-functions-worker in this file
# The Python Worker is managed by the Azure Functions platform
# Manually managing azure-functions-worker may cause unexpected issues

azure-functions

0 comments on commit de10eb3

Please sign in to comment.