question

EngyTawadros-3500 avatar image
0 Votes"
EngyTawadros-3500 asked MughundhanRaveendran-MSFT answered

Azure Function

I have a Python Script that generates data in a data frame output that I need to store in the database. what will be the best way to run my Python script? Azure Function or Notebooks and why??

azure-functionsazure-synapse-analytics
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

EricBoyd avatar image
2 Votes"
EricBoyd answered

Hello @EngyTawadros-3500

If you want to execute your script manually and interactively, then Azure Notebooks will work great.

If your script needs to execute based on an event occurring, like a http request to an API, a new message in Service Bus, an event in Event Hubs, a timer elapsing, a file being saved to storage, etc., and your script executes in a reasonably short period of time, then Azure Functions is a great service.

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

MughundhanRaveendran-MSFT avatar image
2 Votes"
MughundhanRaveendran-MSFT answered

@EngyTawadros-3500 ,

Thanks for reaching out to Q&A.

It actually depends on the business requirements and how the script needs to be invoked. Azure notebooks are like a document that contains a lot of content and python script snippets where the pthon script can be executed within the document itself by invoking manually. It is widely used in datascience and academics field. Whereas Azure functions is very vast and it is microservice based architecture.

Azure functions can be triggered in many ways and can also be scheduled to run at specific times. You can choose the underlying OS and has various hosting options. If you would like to have long running functions, you can choose durable functions as well. You have the ability to run locally and also host it in Azure functions runtime. Functions can be integrated with lots of other Azure services as it has built in bindings. There is also a dedicated language worker for python and you will have a lot of control in terms of performance/connections/hosting.

I hope this helps!

Please 'Accept as answer' and ‘Upvote’ if it helped so that it can help others in the community looking for help on similar topics.

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.