1

I have an ASP.NET Core 6 Web API that has a simple endpoint /resources/{id} where id is a string. Everything worked as expected in local development. We then deployed it to a standard Azure App Service.

We got a bug report when this particular URL was requested /resources/d.dd. The response was

The resource you are looking for has been removed, had its name changed, or is temporarily unavailable.

I have tried with these variations

  1. resources/d.dd/
  2. resources/d.vn (and other top-level domain name)
  3. resources/hello.dd
  4. resources/d.ddd
  5. resources/d.txt

All worked except for d.dd without the last / in the URL.

I ran it locally. It worked. The d.dd was parsed and seen as the id.

It seems that .dd is routed as a file extension by the webserver on Azure. I spent hours looking around and checking Azure settings. I found nothing.

I am looking for a hint or suggestion. Thank you for your time and help.

Thai Anh Duc
  • 524
  • 6
  • 12

1 Answers1

1

UPDATE

We can create a web.config manually, and copy the content from azure and paste it.

Every time when you deploy it, it will include this web.config file.

Like:

enter image description here

Test Result

enter image description here

Jason Pan
  • 15,263
  • 1
  • 14
  • 29
  • That requires a manual update directly in the web.config of the Azure App Service. The config is gone when the app is redeployed (from an ARM template). I wonder if there is any alternative or something in the App Service from Microsoft – Thai Anh Duc Jul 15 '22 at 05:40
  • @ThaiAnhDuc We can create `web.config` manually, you can find the details in the link I have updated it. And your issue can be fixed. – Jason Pan Jul 15 '22 at 07:46