Choosing Azure Function vs Azure App Services ?

David Maryo 116 Reputation points
2022-03-23T18:50:23.65+00:00

I have a python script that hits a Public API and writes the results in a CSV file. The script runs for closely 5-6 hours. And I wanted to run this script in automated fashion two times every month. I am a bit confused in finalizing whether to go with Azure Function App or App Services for this said scenario? What is the recommendation for this use and which is cost efficient?

Azure Functions
Azure Functions
An Azure service that provides an event-driven serverless compute platform.
5,072 questions
Azure App Configuration
Azure App Configuration
An Azure service that provides hosted, universal storage for Azure app configurations.
237 questions
0 comments No comments
{count} votes

3 answers

Sort by: Most helpful
  1. Carlos Solís Salazar 17,971 Reputation points
    2022-03-24T01:05:58.027+00:00

    Hi @David Maryo

    Thank you for asking this question on the **Microsoft Q&A Platform. **

    My recommendation is that you should go with the Azure Functions, the Azure Function is a lot cheaper than the Azure App Services.

    You will need a Logic App for your scheduler and a Storage Account to store the CSV file.

    Even with these other resources, the Azure function is cheaper.

    You can calculate the prices of these solutions with the price calculator https://azure.microsoft.com/en-us/pricing/calculator/

    Hope this helps,
    Carlos Solís Salazar

    ----------

    Accept Answer and Upvote, if any of the above helped, this thread can help others in the community looking for remediation for similar issues.

    NOTE: To answer you as quickly as possible, please mention me in your reply.


    1 person found this answer helpful.
    0 comments No comments

  2. Bruno Lucas 4,431 Reputation points MVP
    2022-03-24T02:09:19.737+00:00

    Hi David, 5, to 6 hours is quite a long time. Both Azure functions and Azure App Services have some limits depending of the plan and function type. An Azure function using and http trigger (works like a rest api) will timeout in 230 s regardless the plan if your code is idle. You may need to do something like a azure function time trigger to invoke the public api and append data to the csv. Any trigger that is not the http trigger on a premium plan should do it. How are you planning to process that? Do you pass individual requests to this API and append to the CSV?
    Also bare in mind one of the reasons Azure Function is cheap is because you don't pay when you don't run it. Maybe a long running data job is worthy checking Azure Data Factory :https://www.sqlshack.com/integrating-apis-into-data-pipelines-with-azure-data-factory/ and consider cost vs reliability

    186321-image.png

    0 comments No comments

  3. Samy Abdul 3,376 Reputation points
    2022-03-24T07:41:57.657+00:00
    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.