1
votes

I want to use ASP.Net Directives in a TXT file. Typically, I would add a handler mapper for that. But how can I do that in Azure App Service? Adding the following handler (D:\Windows\Microsoft.NET\Framework64\v4.0.30319\aspnet_isapi.dll): enter image description here

generates the following exception:

Most likely causes:
  • IIS received the request; however, an internal error occurred during the processing of the request. The root cause of this error depends on which module handles the request and what was happening in the worker process when this error occurred.
  • IIS was not able to access the web.config file for the Web site or application. This can occur if the NTFS permissions are set incorrectly.
  • IIS was not able to process configuration for the Web site or application.
  • The authenticated user does not have permission to use this DLL.
  • The request is mapped to a managed handler but the .NET Extensibility Feature is not installed.

Things you can try:

  • Ensure that the NTFS permissions for the web.config file are correct and allow access to the Web server's machine account.
  • Check the event logs to see if any additional information was logged.
  • Verify the permissions for the DLL.
  • Install the .NET Extensibility feature if the request is mapped to a managed handler.
  • Create a tracing rule to track failed requests for this HTTP status code. For more information about creating a tracing rule for failed requests, click here.

and I don't think there is much I can do with the suggestions.

So what's the right way to map static file to ASP.Net pipeline in Azure App Services?

1
Try to use the path D:\home\site\wwwroot to refer to your app's root directory, refer to this link.Joy Wang-MSFT
@JoyWang that path is given there for reference only, it does not contain any DLLs. It will be used if you upload your PHP binaries in there for example.avs099
@avs099 Is there any update?Lee Liu

1 Answers

0
votes

In Azure web service, we don't have to use aspnet_isapi.dll to use ASP.Net pipeline because the built-in server is IIS. We can see below screenshot, i published a ASP.NET Core to Azure web app, and we can see the Microsoft.Owin.Host.SystemWeb.dll under the root folder, this means that my ASP.NET Core application is hosted in IIS. (Besides IIS, are there any other better servers to support OWIN?).

Thus, if you are using ASP.NET Core and you want to use IIS pipeline, i think it is impossible because the IIS is just a reverse proxy server in this situation. You need to delete the Microsoft.Owin.Host.SystemWeb.dll and modify the web.config file (I tried and worked) but doing this will cause your ASP.NET Core application crashing.

If you are using ASP.NET Framework or just a simple static web, we can do it with our code and web.config.

enter image description here