43

Offlate almost every website/api service/mobile service I deploy, When I hit any route apart from default one, I get the following error 'The resource you are looking for has been removed, had its name changed, or is temporarily unavailable.'

For testing I created a simple ASP.Net WebAPI app and ASP.Net MVC Website and deployed to Azure. It gets deployed and default pages come up. For any link after that, I get that error.

Below is the mobile service.. created and uploaded without modification and configured facebook authentication on portal.azure.com https://wayweb.azurewebsites.net/.auth/login/facebook/callback

Copy of code is at https://1drv.ms/u/s!AkQ9G9AdaYOPgaZ-vXUdlSW9RuQzOQ

Any idea, what am I doing wrong?

Sibeesh Venu
  • 18,755
  • 12
  • 103
  • 140
Pooran
  • 1,640
  • 2
  • 18
  • 25
  • Without seeing any code, any configuration (such as how you set up the routes), or knowing anything about your app deployment, there's nothing that anyone can do except guess. As written, this question will likely be closed as 'unclear what you're asking'. You should consider editing your question to show more concrete details. – David Makogon Jun 24 '16 at 20:05
  • @DavidMakogon I updated the question. It is happening for any new website / api service I create. Works for default route and any other routes it fails. It would surely help in rephrasing the question to get the message across. https://wayweb.azurewebsites.net/.auth/login/facebook/callback – Pooran Jun 24 '16 at 20:28
  • Below is the mobile service.. created and uploaded without modification and configured facebook authentication on portal.azure.com https://wayweb.azurewebsites.net/.auth/login/facebook/callback Any help would be highly appreciated. – Pooran Jun 24 '16 at 20:34
  • 1
    Please *edit* your question - as I already mentioned. Comments aren't the place for all these extra details you added. Actually... you really didn't include any details aside from linking to your website. That only reveals that you're using Azure Web Apps. There's still no way to help you - you haven't shown **any** code, **any** configuration of routes. – David Makogon Jun 24 '16 at 21:06
  • Nice and very clear question to me since i am facing same issue here – Sergio Rezende Aug 29 '22 at 23:32

9 Answers9

52

Add web.config file to your azure directory. Add the code below into it.

<configuration>
<system.webServer>
    <rewrite>
      <rules>
        <rule name="Main Rule" stopProcessing="true">
                <match url=".*" />
                <conditions logicalGrouping="MatchAll">
                    <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
                    <add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
                </conditions>
                <action type="Rewrite" url="/" />
            </rule>
        </rules>
    </rewrite>
</system.webServer>
</configuration>
Ifesinachi Bryan
  • 2,240
  • 1
  • 19
  • 20
31

If you can't open a json file or any other file even though it exists, try to add:

<system.webServer>
<staticContent>
  <mimeMap fileExtension=".woff2" mimeType="application/x-font-woff" />
  <mimeMap fileExtension=".woff" mimeType="application/x-font-woff" />
  <mimeMap fileExtension=".json" mimeType="application/json" />
</staticContent>

Stephen Rauch
  • 47,830
  • 31
  • 106
  • 135
Amer Jamaeen
  • 677
  • 8
  • 16
18

It could help:

To remedy the problem, you need to provide a web.config file into your Angular 2 application.

https://hgminerva.wordpress.com/2016/04/27/hosting-angular-2-in-windows-azure-error-the-resource-you-are-looking-for-has-been-removed-had-its-name-changed-or-is-temporarily-unavailable/

Oleg
  • 1,467
  • 4
  • 26
  • 39
  • 1
    I have added web.config file. But getting another problem : *systemjs.config.js:1 Uncaught SyntaxError: Unexpected token <*. Any suggestion? – Girish Rathod Mar 08 '17 at 07:21
1

For me this error had occurred when I did runAllManagedModulesForAllRequests="false"

    <modules runAllManagedModulesForAllRequests="true">
        <add type="DevExpress.Web.ASPxHttpHandlerModule, DevExpress.Web.v20.1, Version=20.1.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" name="ASPxHttpHandlerModule" />
        <remove name="FormsAuthentication" />
        <remove name="DefaultAuthentication" />
        <remove name="OutputCache" />
        <remove name="AnonymousIdentification" />
        <remove name="RoleManager" />
    </modules>
1

I tried all of the above options, none could resolve my issue.

I resolved it by adding the web.config file into my src folder and injecting it from the package.json file.

"tsConfig": "tsconfig.app.json",
"aot": true,
"assets": [
    "src/favicon.ico",
    "src/assets",
    **"src/web.config"**
],
Peter Csala
  • 17,736
  • 16
  • 35
  • 75
Favour Emmanuel
  • 111
  • 3
  • 11
1

Security Audit - my security auditor asked me to removed

Physical Path C:\Users\Dell\Documents\Development\WebServicePortal\PyWebServicePortal\Dashboard\DashboardView\robots.txt

I was getting 404 (The resource you are looking for has been removed, had its name changed, or is temporarily unavailable.), I wanted to use custom error if resource code found. I've used following code:

<httpErrors errorMode="Custom" existingResponse="Auto" defaultResponseMode="File" >
      <remove statusCode="404"/>
      <error statusCode="404" path="ErrorPages/Oops.html" />
    </httpErrors>

enter image description here

Vinod Joshi
  • 7,696
  • 1
  • 50
  • 51
0

This is the same message error related to a problem with versioning issues of System.Net.Http.dll, System.Net.Http.Formating.dll and System.Net.Http.WebRequest.dll. I fixed that posting those assemblies in the bin folder of my Azure Web API, even though they were supposed been used from global cache. You can see details in ASP Web API not working in Azure

Fidel Orozco
  • 998
  • 11
  • 19
0

To resolve this issue, Add web.config file into src folder(root directory) with follow code.

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
  <system.webServer>
    <rewrite>
      <rules>
        <rule name="AngularJS" stopProcessing="true">
          <match url=".*" />
          <conditions logicalGrouping="MatchAll">
            <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
            <add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
            <add input="{REQUEST_URI}" pattern="^/(api)" negate="true" />
            <add input="{REQUEST_URI}" pattern="^/help" negate="true" />
          </conditions>
          <action type="Rewrite" url="/" />
        </rule>
      </rules>
    </rewrite>
  </system.webServer>
</configuration>

in above code, API Path is very important. This may be differ based on your folder structer on your server.

<add input="{REQUEST_URI}" pattern="^/(api)" negate="true" />

In my case, We have folder name 'PublishAPI' and inside this folder we have kept all deployed .dlls So in my cases path should be like as below

<add input="{REQUEST_URI}" pattern="^/PublishAPI/(api)" negate="true" />
Nimesh
  • 3,342
  • 1
  • 28
  • 35
0

It was giving same error for our ASP.Net MVC application, all things were setup in IIS but unfortunately without success. We simply changed the name of "Project Url" to PIDWeb instead of PID.Web in properties of web application in Section "Web" and in the sub section "Servers" and clicked on "Create Virtual directory". And amazingly, it worked.

However the dot is not supported!