Cloud functions custom path

Mahesh Govind - FT 21 Reputation points
2022-11-04T13:30:41.387+00:00

Dear experts
One more query for cloud functions.
We would like to define a path like the following .
/biller/org1t/pay
/biller/org2/pay

We were not not able to define the nested paths with cloud functions . Could you please give some pointers for the same .

-mahesh

Azure Functions
Azure Functions
An Azure service that provides an event-driven serverless compute platform.
4,566 questions
Azure ISV (Independent Software Vendors) and Startups
Azure ISV (Independent Software Vendors) and Startups
Azure: A cloud computing platform and infrastructure for building, deploying and managing applications and services through a worldwide network of Microsoft-managed datacenters.ISV (Independent Software Vendors) and Startups: A Microsoft program that helps customers adopt Microsoft Cloud solutions and drive user adoption.
91 questions
{count} votes

Accepted answer
  1. AnuragSingh-MSFT 21,236 Reputation points
    2022-11-07T06:13:10.74+00:00

    Hi @Mahesh Govind - FT ,

    Welcome to Microsoft Q&A and thank you for posting this question here.

    I understand that you are looking for customizing Azure Function http trigger endpoint. You can customize this route using the optional route property on the HTTP trigger's input binding. You can use any Web API Route Constraint with your parameters. Please see the following link for more details and sample code snippet - Customize the HTTP endpoint in Azure Function Apps

    Edit 11/08/2022

    As mentioned in the comment below, you are using a golang server as custom handler in Azure Function. In this case, you can define custom routes/path using the route field in function.json file. Please see here for a basic overview of the relationship between the Functions host and a web server implemented as a custom handler.

    Consider the following scenario, similar to the context mentioned in question - I have 2 handler functions in my golang web server. I have mapped the path in main() of the custom handler code as below:

    258213-image.png

    In order for the Azure Function to route the request to these 2 different handle functions, create 2 different functions in Azure function project with their own function.json file. This json file would contain details of how the mapping from Azure function happens to the custom handle function.

    258190-image.png

    The function host identifies 2 functions (depending on the route):

    258271-image.png

    Depending on the URL accessed, the request is routed to respective function:

    258281-image.png

    Please let me know if you have any questions.

    ---
    Please 'Accept as answer' and ‘Upvote’ if it helped so that it can help others in the community looking for help on similar topics.


0 additional answers

Sort by: Most helpful