@rohith v We appreciate your contact. This kind of error often occurs when there is a problem in the pipeline after deployment. To identify the source of the problem, please follow Hafiz's answer here to turn on detailed Logging in the App Service:
Azure website message “You do not have permission to view this directory or page.”. What to do??.
After this, you will get to know about the exact miss in the deployment.
If you are deploying ASP.NET core to app service through azure pipelines, you may check to see if web.config is in the build files else you can add the web.config file. This should fix the issue.
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<system.webServer>
<handlers>
<add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModuleV2" resourceType="Unspecified" />
</handlers>
<aspNetCore processPath="dotnet" arguments=".\YourAspNetCoreApp.dll" stdoutLogEnabled="false" stdoutLogFile=".\logs\stdout" />
</system.webServer>
</configuration>
Let us know if further query or issue remains.