2

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

[1] https://learn.microsoft.com/en-Us/azure/azure-functions/functions-bindings-http-webhook-trigger?tabs=in-process%2Cfunctionsv2&pivots=programming-language-python

1
  • Can you link to the documentation example (non-naked link)? (But without "Edit:", "Update:", or similar - the question should appear as if it was written right now.) Commented May 20, 2022 at 10:48

1 Answer 1

2

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

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.