Azure Function with TDS(Tabular Data Stream) and MFA enabled Authentication

I have a C# console App which uses the below connection string and it works fine, when i run it it asks for the password and once authenticated it works perfectly and i can access dynamics crm online database. However now i want to move the code and use Azure Function, when in Visual Studio it works same as in Console App but the interactive Azure AD authentication won't work when it is published to Azure. Does anybody has any idea how to implement this. I can't find any article where i can see any Demo or documentation.

string ConnectionStringTDS = @"Driver={ODBC Driver 17 for SQL Server};SERVER=*******.crm.dynamics.com;DATABASE=******;Authentication=ActiveDirectoryInteractive;UID=XRMDe**@****.com";

I have enabled TDS to access database using SQL Query. MFA is enabled in my account. Using service principal.