I've made a web app in .NET 6.0 using WTelegramClient. It works fine locally but when I try to publish it to Azure App Service i obtain the following error: HTTP Error 500.30 - ASP.NET Core app failed to start
I tried to remove WTelegramClient initialization from app and it works fine on Azure too.
This is my Config function:
public static string Config(string what)
{
switch (what)
{
case "api_id": return Instance.m_oTgConfig.api_id;
case "api_hash": return Instance.m_oTgConfig.api_hash;
case "phone_number": return Instance.m_oTgConfig.phone_number;
case "verification_code": Console.Write("Code: "); return Console.ReadLine();
case "first_name": return Instance.m_oTgConfig.first_name; // if sign-up is required
case "last_name": return Instance.m_oTgConfig.last_name; // if sign-up is required
case "password": return Instance.m_oTgConfig.password; // if user has enabled 2FA
case "session_pathname": return "/WTelegram.session";
default: return null; // let WTelegramClient decide the default config
}
}
Am I doing somethin wrong with the .session file?
I think that the problem is that I must to insert verification_code (telegram OTP) by hand from the console. In local I do it from the console. How can I do the same thing in Azure? If I run MyApp.exe from Azure's console it do not ask anything.