AbhiArora
AbhiArora

Reputation: 182

How to make a function as default in azure function app?

I have an azure function app (abc.azurewebsites.net) and have a function named Function1 defined in it. (abc.azurewebsites.net/api/Function1?code=def==)

Is there a way in which, I can define this Function1 as default and all the incoming requests to abc.azurewebsites.net gets routed to my Function1?

Thanks.

Upvotes: 0

Views: 507

Answers (1)

George Chen
George Chen

Reputation: 14334

You could use proxy to get this.

Follow this tutorial, and the Route template should be /, and then you should change your function authLevel to anonymous like this.

1.Set the application setting add HELLO_HOST(any parameter same as the backend url) with value <YourBackendApp>.azurewebsites.net.

enter image description here

2.Create the proxy.

enter image description here

3.Set your function to anonymous then your function don't need API keys code to call it.

enter image description here

Then below my test result, it's a HTTP trigger function with query string &name=<yourname>.

enter image description here

Upvotes: 1

Related Questions