Azure is decoding characters in the URL before reaching the application

Jkuhl 35 Reputation points
2023-01-12T17:17:38.88+00:00

In our backend API, we have an endpoint with a path variable and we need to be able to support certain special characters. To accomplish this, we are encoding the path variable with UTF-8 before hitting the endpoint. This works for most special characters, but the problem we are facing is that Azure is decoding some of the encoded characters before the application receives the request.

Use this endpoint as an example: GET: /example/{pathParam}/test

Say I need to provide "TEST/1" as the input. First I would encode the special character and hit the endpoint with this url: GET: /example/TEST%2F1.

This works fine when I am running the application locally, but when I hit the apps deployed on Azure, I receive a 404 not found error for path /example/TEST/1. Does anyone know if there is a way to prevent Azure from decoding characters in the URL before it sends the request to the application?

ASP.NET Core
ASP.NET Core
A set of technologies in the .NET Framework for building web applications and XML web services.
4,615 questions
ASP.NET API
ASP.NET API
ASP.NET: A set of technologies in the .NET Framework for building web applications and XML web services.API: A software intermediary that allows two applications to interact with each other.
343 questions
Azure App Service
Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
7,912 questions
{count} votes

1 answer

Sort by: Most helpful
  1. hossein jalilian 8,150 Reputation points
    2024-02-02T21:45:51.8966667+00:00

    Thanks for posting your question in the Microsoft Q&A forum.

    Yes, this was a bug reported under issue number 9290 and was addressed in a fix that was implemented on October 12, 2023. You can find more details about the bug fix in the following GitHub pull request: https://github.com/Azure/azure-functions-host/pull/9402. Your issue should now be resolved.

    Please don't forget to close up the thread here by upvoting and accept it as an answer if it is helpful


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.