Вопрос

I created a web application and added an ELMAH module for error logging. It was working with my local development environment: when i access URL http://localhost:52584/elmah.axd it shows me a valid page:

enter image description here

When i testing it after uploading on azure portal it shows me an error page:

enter image description here

Is there any specific configuration i need to do for Azure platform?

Also i have done form authentication on my web application, so when I try elmah.axd it will redirect to login page and i need to login first. I would like to remove that form authentication, particularly for elmah.axd. How can i achieve this?

Это было полезно?

Решение

The nuget package does not add the following important lines to web.config resulting in 403 error.

<elmah>  
    <security allowRemoteAccess="1" />
    <errorLog type="Elmah.XmlFileErrorLog, Elmah" logPath="~/app_data/elmah" />
</elmah>

This should fix the 403. Also you may want to restrict the access to error logs by

<add name="Elmah" verb="POST,GET,HEAD" path="/admin/elmah.axd" type="Elmah.ErrorLogPageFactory, Elmah" resourceType="Unspecified" requireAccess="Script" preCondition="integratedMode" />
Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top