Sitecore 8.1 : azure website forbidden by its access permissions 127.0.0.1

0 投票
最新提问 用户: (260 分)

We are hosting the sitecore on to Azure Web Sites. When looking at the log files, I noticed a LARGE number of errors been logged:

ManagedPoolThread #11 2015:12:20 19:47:59 ERROR Exception in UrlAgent (url: http://localhost/sitecore/service/keepalive.aspx)
Exception: System.Net.WebException
Message: Unable to connect to the remote server
Source: System
   at System.Net.WebClient.DownloadDataInternal(Uri address, WebRequest& request)
   at System.Net.WebClient.DownloadData(Uri address)
   at System.Net.WebClient.DownloadData(String address)
   at Sitecore.Web.WebUtil.ExecuteWebPage(String url, NameValueCollection headers)
   at Sitecore.Web.WebUtil.ExecuteWebPage(String url)
   at Sitecore.Tasks.UrlAgent.Run()

Nested Exception

Exception: System.Net.Sockets.SocketException
Message: An attempt was made to access a socket in a way forbidden by its access permissions 127.0.0.1:80
Source: System
   at System.Net.Sockets.Socket.DoConnect(EndPoint endPointSnapshot, SocketAddress socketAddress)
   at System.Net.ServicePoint.ConnectSocketInternal(Boolean connectFailure, Socket s4, Socket s6, Socket& socket, IPAddress& address, ConnectSocketState state, IAsyncResult asyncResult, Exception& exception)

We are using IPSecurity for IP whitelisting. At first it could be this and added 127.0.0.1 on to whitelisting. However I'm still getting the error above.

Somewhere I read the azure web apps doesn't support localhost or similar.

Has anyone faced this issue and have a solution?

UPDATE:

Applied the solution provided by Marek. However we are seeing new error:

Exception: System.Net.WebException

Message: The remote server returned an error: (403) Forbidden.

Source: System

   at System.Net.WebClient.DownloadDataInternal(Uri address, WebRequest& request)

   at System.Net.WebClient.DownloadData(Uri address)

   at System.Net.WebClient.DownloadData(String address)

   at Sitecore.Web.WebUtil.ExecuteWebPage(String url, NameValueCollection headers)

   at Sitecore.Web.WebUtil.ExecuteWebPage(String url)

   at Sitecore.Tasks.UrlAgent.Run()

2 个回答

0 投票
最新回答 用户: (380 分)

You can specify server url in the keepalive task configuration in web.config:

  <agent type="Sitecore.Tasks.UrlAgent" method="Run" interval="00:15:00">
    <param desc="url">http://YOUR_VALID_HOSTNAME/sitecore/service/keepalive.aspx</param>
    <LogActivity>true</LogActivity>
  </agent>
发表于 用户: (260 分)
Applied the suggested change and we are seeing different error. Please see update above.
0 投票
最新回答 用户: (140 分)

You can use the relative URL instead of absolute. For example:

<param desc="url">/sitecore/service/keepalive.aspx</param>

If you are using the Static/Dynamic IP Restrictions with Azure Web Apps, do not forgot to add the internal Azure IP Address into the <ipSecurity /> section.

<security>
  <ipSecurity allowUnlisted="false">
    <clear/>
    <add ipAddress="0.0.0.0" allowed="true"/>
    ...
  </ipSecurity>
</security>
欢迎来到 Security Q&A ,有什么不懂的可以尽管在这里提问,你将会收到社区其他成员的回答。
...