What is the point of writing REST APIs but in Azure Functions?

I'd say because rest api is an ideal candidate for being a function. It doesnt need a UI, it just returns json (perfect for Azure Function). It doesnt have state (perfect for Azure Function). You invoke it only when you need it, its doesnt have to run always.

All of these combined makes for a nice Azure Function use case. But you dont have to follow this route.


The two big reasons for using functions instead of running a web app are cost and scalability. If your API is getting constant traffic at the same level 24/7 then using a function is not going to be beneficial.

However, if your API is only really getting traffic for a few hours a day, then using a function is likely to save you money, as when no one is hitting it, or load is low, your costs will be very small. Similarly, if your API traffic is very spiking, and you could see large increases in load for short periods, then functions work well for this as they can scale quickly to meet the demand and then scale down again.