diff --git a/function_app.py b/function_app.py index 8af205c..281aaf4 100644 --- a/function_app.py +++ b/function_app.py @@ -10,11 +10,13 @@ def http_trigger(req: func.HttpRequest) -> func.HttpResponse: logging.info('Python HTTP trigger function processed a request.') table_conn_str = os.environ["TABLE_CONN_STR"] + table_client = TableClient.from_connection_string(conn_str=table_conn_str, table_name="visitorCount") entity = table_client.get_entity(partition_key="VisitorCount", row_key="CurrentCount") count = entity["count"] + 1 entity["count"] = count + table_client.update_entity(mode="merge", entity=entity) return func.HttpResponse(f"{count}", status_code=200)