Reputation: 51
How do you trigger an Azure function via HTTP without providing a variable?
Microsoft's documentation example [1] got an example where you have to provide a variable (name) in the URL. How can I remove all code associated with the variable such that it just uses an HTTP connection?
The reason for this is that I want to run my function using Azure Data Factory, but my function does not need an input
Upvotes: 2
Views: 1426
Reputation: 29880
I am not sure what the actual problem is. Just remove the code that accesses the querystring like this:
import logging
import azure.functions as func
def main(req: func.HttpRequest) -> func.HttpResponse:
logging.info('Python HTTP trigger function processed a request.')
return func.HttpResponse(f"Hello there, This HTTP triggered function executed successfully.")
and call it using the function url, for example https://xxx.azurewebsites.net/api/HttpTrigger1?code=function_key_here
Upvotes: 2