none
Azure Function Proxies stop working RRS feed

  • Question

  • Hi,

    My proxies were working fine, but after not accessing for an hour or so they stop working. This is running on a consumption plan. The proxies.json is as below:

    {
      "$schema": "http://json.schemastore.org/proxies",
      "proxies": {
        "default": {
          "matchCondition": {
            "route": "/",
            "methods": [
              "GET",
              "OPTIONS"
            ]
          },
          "backendUri": "https://%BLOB_HOST%/content/index.html"
        },
        "css": {
          "matchCondition": {
            "route": "/css/{*rest}",
            "methods": [
              "GET",
              "OPTIONS"
            ]
          },
          "backendUri": "https://%BLOB_HOST%/content/css/{rest}"
        },
        "img": {
          "matchCondition": {
            "route": "/img/{*rest}",
            "methods": [
              "GET",
              "OPTIONS"
            ]
          },
          "backendUri": "https://%BLOB_HOST%/content/img/{rest}"
        },
        "js": {
          "matchCondition": {
            "route": "/js/{*rest}",
            "methods": [
              "GET",
              "OPTIONS"
            ]
          },
          "backendUri": "https://%BLOB_HOST%/content/js/{rest}"
        }
      }
    }
    Trying to get the debug log (by adding the Proxy-Trace-Enabled header as  described in Troubleshooting Proxies) doesn't seem to work either, the response just contains the 'Your Azure Function App is up and running.' page.

    Any suggestions as to why they stop working?

    Thanks,
    Chris

    Tuesday, September 25, 2018 1:19 PM

Answers

  • Sorry, I should have mentioned: I killed your worker process to cause it to restart in a way that doesn't trigger the issue. That's why it was working.

    But yes, testing it over the next few days will help validate that the App Setting helps. On the downside, you will see slower cold starts. So this is just a workaround, and there is a bug at the root that the Functions Team needs to address.

    David

    Wednesday, September 26, 2018 10:29 PM

All replies

  • Hi Chris,

    Is this a v1 or v2 Function App?

    thanks,
    David

    Tuesday, September 25, 2018 4:49 PM
  • This is a v2 Function App, here: https://lrais.azurewebsites.net/
    Wednesday, September 26, 2018 10:02 AM
  • Hi there,

    I think this is expected behavior and can be due to cold start concept as you are running the apps in Consumption plan. It takes some time to start after being idle for some time. If you want this function proxy to stay active always, keep calling it from another function which has scheduled trigger.

    If this helps your current question, mark as answer.

    Thanking you,

    Mohamed Ibrahim

    Wednesday, September 26, 2018 11:02 AM
  • I've tried visiting the url a number of times over a period of a few minutes and it never starts up again.

    Also, I've added a keep alive timer, but same again, it just doesn't start.

    Wednesday, September 26, 2018 12:27 PM
  • Hi Chris,

    Not sure why. May be the back-end url is down?

    Generally there is a health check endpoint exposed by the back end services of API Management service, whcih is used to determine whether the endpoint is healthy.

    Thanking you,

    Mohamed Ibrahim

    Wednesday, September 26, 2018 12:51 PM
  • When you say it's not working, can you clarify exactly what you mean? Specifically:

    • What URL are you requesting?
    • What behavior are you observing?
    • What behavior are you expecting instead?
    • Please include the UTC time of one such request


    thanks,
    David

    Wednesday, September 26, 2018 6:17 PM
  • These are function proxies for a Vue base SPA stored in blob storage: lrais.blob.core.windows.net e.g. https://lrais.blob.core.windows.net/content/index.html. The Vue web app is fairly simple, displaying a map with live ship positions on it. It is using Azure SignalR service, calling an api function to get the SignalR url and access token. The API functions appear to be working fine, as I can call them via Postman and get the correct responses.

    The proxies url is https://lrais.azurewebsites.net, when I make a request to this url I get the 'Your Functions 2.0 app is up and running' page.

    I've just made a request at Wed, 26 Sep 2018 18:48:48 UTC.

    Thanks for your help,
    Chris



    Wednesday, September 26, 2018 6:55 PM
  • Chris, we have a possible theory. Can you try adding an App Setting named WEBSITE_USE_PLACEHOLDER to your app, and setting it to 0?

    thanks,
    David

    Wednesday, September 26, 2018 8:22 PM
  • I've been away for a couple of hours, come back to the url and all is working! Not sure why that is, but I've added the WEBSITE_USE_PLACEHOLDER app setting and will keep trying over the next few days.

    Thanks,
    Chris

    Wednesday, September 26, 2018 10:20 PM
  • Sorry, I should have mentioned: I killed your worker process to cause it to restart in a way that doesn't trigger the issue. That's why it was working.

    But yes, testing it over the next few days will help validate that the App Setting helps. On the downside, you will see slower cold starts. So this is just a workaround, and there is a bug at the root that the Functions Team needs to address.

    David

    Wednesday, September 26, 2018 10:29 PM
  • The proxies have worked fine all day today, so looks like adding the WEBSITE_USE_PLACEHOLDER app setting has fixed it, thanks. Is there anywhere I can track the status of the bug?

    Chris

    Thursday, September 27, 2018 8:26 PM
  • Hi Chris,

    You can track the status on https://github.com/Azure/azure-functions-host/issues/3533

    thanks,
    David

    Thursday, September 27, 2018 8:43 PM