'Azure HTTPS Trigger Function vs Dot Net 6 Web API
I'm going to build rest Api layer using dot net 6. but I have two options available
- create rest Api layer as azure functions (http triggers)
- create web Api using dot net 6.
We are expecting high volume of request to these Api. What would be the best and cost optimize approach to implement this Api layer?
Solution 1:[1]
AFAIK, there will be more logs generated in Azure Functions Http Trigger APIs and Web APIs during its runs and executions.
There are few costs Optimization approaches that can be done in Azure Functions host.json file level.
Based on different values of Host.Results in host.json file of the Azure Functions Project, it will generate different level of logs like Information logs, failed function executions, dependencies logs, customMetris, customEvents, traces, etc.
Also, there are few other techniques helps you to control your Monitoring Cost of the Function Apps like Sampling, daily cap setting, Pre-aggregate metrics, customizing the logs collection.
I have given a workaround of Azure Functions Python application to minimize the logs required for tracing the errors. Please check the below references:
- How to optimize Costs of Applicaiton Insights in Azure Functions
- Cost Optimization Techniques in Azure Functions
As per Md Farid Uddin Kiron suggestion, that cost management also depends upon the Hosting Plan you choose for the Azure Functions in which Consumption Plan gives you optimized cost and high performance whenever the high load comes, you can scale out the instances running your application to give better performance.
Coming to the Web API - First, it depends on the Hosting Plan you choose like Basic, Free, Shared, Premium and Standard.
Because it doesn't charge on the features of the App Service Plan, it charges based on the usage of that features and the instances in that selected App Service plan are charged regardless of how many apps you kept in the ASP.
To know more information regarding optimizing the cost of App Services like Web API, refer this App Service plans - Azure App Service | Microsoft Docs.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | HariKrishnaRajoli-MT |
