So, I'm using .NET Framework 4.7 Web API and using "System.Speech.dll" to speak some text, save to WAV, convert to MP3 (Using LAME), then append to start of another MP3 and return back the updated MP3.
Everything works perfect in my local. Here's the actual code:

Now, right after I publish to "Trial" version (12 Month Trial) web app on Azure, it doesn't work and I always get "502 Bad Gateway Error" (screenshot attached)
Now, I also checked the "eventlog.xml" file on Azure, and found this:
I have already updated the "bin" folder and added "System.Speech.dll" there through "Advanced Tools" in Azure. I'm really not sure what's the issue now.
I'm on a deadline so really stressed, can someone please help me out? I would highly appreciate it, thanks!
Waiting eagerly for a positive response...


What @CoolBots said is reasonable, but I still recommend you upload the sample code to git to test whether the azure web app service supports your project through code publish.
Upload the code to github and use continuous deployment to operate. It is recommended that you choose Linux and windows for testing. If the test fails, it is recommended to raise a support ticket on the portal.
If the above solution does not help you in the end, you can only use the suggestions of CoolBots, and you can use docker for deployment in an economical way. If the budget is sufficient, virtual machines are also possible.