Poc to Prototype for the python functions in Azure
Run notion to create it

Run it in replit to test

Set the server

Fix naming issues

Practical create in the portal

Add the httptrigger

Even Azure is ready for the testing

Cut the tested function

Initila basic run

Add parameters and run

Use the testing parameters
{
"html_to_text":"Dear candidate, we are looking for a talented software engineer with experience in C#, .NET, and SQL. Please respond if you are interested.",
"my_key_value":["software", "C#", ".NET", "SQL"]
}
Backup Code for the function ( crying baby backup)
`import logging
from azure.functions import HttpRequest, HttpResponse
def process_text_array(html_to_text, my_key_value):
result = [key for key in my_key_value if key in html_to_text]
return result
def main(req: HttpRequest) -> 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 HttpResponse(f"Hello, {name}. This HTTP triggered function executed successfully.")
else:
return 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
)`
see logs

warning sign 3rd party is not supported with linux
Adding third party dependencies in the Azure portal is currently not supported for Linux Consumption Function Apps. Click here to setup local environment.Learn more
documentation
https://learn.microsoft.com/en-us/azure/azure-functions/functions-bindings-http-webhook-trigger?tabs=python-v2%2Cisolated-process%2Cnodejs-v4%2Cfunctionsv2&pivots=programming-language-python
find parameter

https://learn.microsoft.com/en-us/python/api/azure-functions/azure.functions.httprequest?view=azure-python
research similar cases
https://github.com/Azure/azure-functions-python-worker/issues/762
update the runner namers

get error from monitor

Logs can be seen

so tactics > test in replit and see the runner nos in azure appinsights
Simplified json testing

test access of the parameters

auto inserted one is different
more structure and more whole

basic for errors> https://github.com/Azure/azure-functions-python-worker/issues/762
debugger needs to be set there

errors not at real time

check json which is valid

none real time debug is an issue

Can i take it inside replit?

it can import

replit feels it is checking the syntax

here

dynamicly coded does not hit the code that does not run

stub line by line ?

open up slowly

found the error at 7

Feels like there is extra paranthesis

too many linting i missed the bottom one

json sub action

test different versions

Imported from rifaterdemsahin.com · 2024