6
votes

I have a WebAPI application running on Azure WebSites. It is running in Basic mode and I have the option to make it "Always On". There seems to be conflicting information online about what this means exactly. I know the effect, but the "how" matters a lot here. In particular, does something automatically hit an endpoint in my application periodically? If so, can I control the endpoint it hits?

As I mentioned, it is a Web API application and the default route does non-trivial work and results in a notable amount of outbound traffic and it will also result in items being placed onto a work queue that will eventually be processed. I want the application always on (no cold start times) but I don't want some service making requests of application.

1
some information was in this post: stackoverflow.com/questions/21840983/…Erik Oppedijk
I see this tidbit, "If a site happens to restart for any other reason Always On will make sure to start your site and send a request to the site root /." which suggests that they do hit site root on startup. I am still curious whether they will hit site root to keep it alive.Micah Zoltu
Doing non-trivial work on the "default" URL of any service seems like it would lead to this kind of problem; most automated systems make the assumption that the root of a site is just a landing page. I would strongly suggest changing that design so an HTTP GET on your application root costs you as little as possible.Paul Turner
@Micah, yes it will hit the root of your website.Amit Apple
@Tragedian I agree, and am working towards a model where site root does nothing. The services I write tend to do only one thing, so they only have one endpoint and putting that endpoint at default seemed reasonable. However, if not Azure punishing me for it then someone else will eventually. :(Micah Zoltu

1 Answers

9
votes

As soon as your Azure Website is marked as AlwaysOn, your site root will be hit within a few seconds. We also make sure your site is up and running on all the workers (if you have configured auto scale option or such). After that, if the worker process crashes, alwaysOn makes sure that it comes back up. You cannot control the endpoint that it hits.