Hey @DevBuster007 - Welcome to MS QnA!
The following:
I can use Azure function and build an API to get the data and store in Cosmos DB.
Then another Azure function which will run every hour, get the data, place in file and push to sftp server.
will definitely work, and you'd build the solution & manage DevOps like any codebase, not to mention any billing difference there maybe. I would suggest Logic Apps though because you can build your solution very quickly using the design-first approach & leverage the connectors ecosystem for CosmosDB & SFTP, etc. If you have any specific queries around implementation, let me know and I'd be happy to weigh in and help.