question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Customize default route on domain root level

See original GitHub issue

[Feature] request

Current status

Feature request

Possible implementation

App setting AzureWebJobsDefaultRoute:

  1. defaultPage Standard website (“Your Azure Function App is up and running.”) -> default value
  2. emptyPage Empty website
  3. customPage Custom website
  4. function Custom Azure Function

AzureWebJobsDisableHomepage would be obsolete in this scenario.

Detailed settings in host.json:

{
    // Configuration settings for default route:
    "defaultRoute": {
        // Defines the path for a custom website which will respond to requests to the default route.
        // Requires app setting "AzureWebJobsDefaultRoute" value "customPage" to be processed. 
        "customWebsitePath": "/home/site/wwwroot/mywebsite/index.html",
        // Defines the Azure Function which will respond to requests to the default route.
        // Requires app setting "AzureWebJobsDefaultRoute" value "function" to be processed. 
        "functionName": "MyHttpCSharp1"
    }
}

Assumption

An Azure Function needs to have a defined route to use custom routing incl. parameters. If the function gets triggered via the default route on domain root level the response uses default values for parameters which may be defined in the function code (e.g. run.csx in C#).

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:6
  • Comments:49 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
mikezkscommented, Mar 1, 2017

IMO the core topics of this issue are resolved now. I suggest to sum up any additional issues connected with this one and to open new ones if there is need for it. Thanks a lot to all of you who contributed actively here.

2reactions
ricklovecommented, Mar 1, 2017

Yes, it works now! #969

(At least with proxies)

A cutting edge website can now be built with a single consumption plan azure function app:

  • Azure Function with it’s web api
  • A function proxy that points to static resources (either a Function or Blob Storage or whatever)
  • Azure CDN
    • Custom domain with free SSL for https
    • Pointing to the Azure Function
    • Query String Pass through for running against the web api
    • Static Files (No Query String) get served by the CDN

Bonus (Global Web Api):

If desired, it might be possible to have multiple api endpoints across the globe (I haven’t tested this):

  • Setup Azure Functions in different regions around the world (1 per continent maybe?)
  • Use Azure Traffic Manager to point to these Azure Functions
  • Point the Azure CDN to the Azure Traffic Manager

Now when a client uses the query string to hit the web api, it will pass through the Azure CDN and route through the Azure Traffic Manager to the nearest Azure Functions App.

Of course your distributed azure function apps will have to use storage queues or something to push their data back to your main region, but your clients are going to have the fastest website and web api no matter where they are in the world.

This is great.

Once, I test this, I will be moving our future production to this architecture.

Read more comments on GitHub >

github_iconTop Results From Across the Web

is there a way to set a default route with React-Router v6
The index route is the route that will be matched and rendered when the path exactly matches the root parent route's path.
Read more >
Configuring a default static route
You can manually create a default static route that the router uses if there are no other default routes to a destination.
Read more >
Configure a Gateway of Last Resort that Uses IP Commands
This document describes how to configure a default route or gateway of last resort.
Read more >
Default static route
A default route defines where packets will be sent if no specific route for the destination network is listed in the routing table....
Read more >
OSPF Default-Information Originate and the Default Route
This post explains the default route and OSPF default-information originate command that can help you with your CCNA 200-301 study.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found