Forum Discussion

dfirka1970's avatar
dfirka1970
Copper Contributor
Oct 29, 2020

NetFramework dll called from Azure Fn + DbConnection

Hi! Two questions:

 

1) Is there any caveat/concern about calling .net 4.61 code from AzFn 3 ? we are porting our app from webapi to AzFn, but not ready to migrate all to netcore.

 

2) Currently each function opens and closes the SqlConnection to Azure Sql as soon as possible. Is there a better practice on AzFns? 

2 Replies

  • Ryan Berry's avatar
    Ryan Berry
    Copper Contributor

    dfirka1970 Yes this is possible using a shared project as one path (https://stackoverflow.com/questions/37608032/net-core-classlibrary-calling-net-framework-class-library)  One thing to note is that since .NET FX is not cross-platform you'll be limited to where you can run this .NET core application.  Also the 1.x version of Azure functions can run .NET Framework code natively: https://docs.microsoft.com/en-us/azure/azure-functions/functions-versions#languages

     

    There are some best practices posted here on SQL Connections in Azure functions: https://stackoverflow.com/questions/41208524/sql-connection-pooling-in-azure-functions#:~:text=Azure%20Functions%20doesn%27t%20currently%20have%20SQL%20as%20an,pooling%20%29%2C%20you%20should%20get%20pooling%20by%20default.

Resources