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.