What is Azure Function?
Definition: An Azure function is the smallest and largest compute service on Azure.
- This is a Serverless offering from Azure.
- This is a single function of computing. A single-action happens when Azure Function's unique address is hit.
- Azure Function call is done via a web browser when a user or an application on the internet hits the standard web address (URL).
- When the URL is hit, the Azure function starts and processes the request and that's it.
The architecture of Azure function
- When we say it is serverless, it is not. It runs on a Virtual machine (compute must be done somewhere), but the point is you don’t need to maintain and worry about the VM, that’s why we call it serverless.
- E.g., There is video upload functionality. Users upload videos on a website.
- Before the video is uploaded it goes through one transformation.
- This transformation is done by the Azure function.
- So, it will go like this. You upload the video >> Azure Function works on it and processes it (Azure Function task ends here) >> Video is uploaded
What is the Azure Function Benefits?
- The azure function will run only when it is needed otherwise not. So, no traffic = no resource usage and if the azure function is not running, you don’t pay for the function when it is not used.
- If a function fails, it will not affect the other instances of the same azure function.