Hi @Sadhana Shree thanks for your patience.
While it is possible to deploy "out of support" versions of .NET Core, such as 2.0, 3.1, and 2.1, to Azure App Service, it is not recommended. Microsoft recommends that you use the latest LTS (Long-Term Support) version of .NET Core for your applications to ensure that you receive security updates and bug fixes.
That being said, if you need to deploy an older version of .NET Core to Azure App Service, you can do so by creating a web app using the runtime stack that matches the version of .NET Core you want to use. As you mentioned, it looks like internally it picks the right runtime and executes successfully. However, keep in mind that using an out-of-support version of .NET Core may expose your application to security vulnerabilities and other issues that may not be addressed by Microsoft.
It is not a mandate to upgrade to the latest LTS version before deploying on Azure App Service, but it is highly recommended. If you cannot upgrade to the latest LTS version immediately, you should at least consider upgrading to a supported version of .NET Core that is not yet out of support.