It should not return the URL like http://something.azurewebsites.net/signup instead custom domain name space.
with JavaScript and C# as well.
able to see using developer options of the browser or using fiddler.
something like
HttpContext.Current.Request.Url.Scheme+"://"+HttpContext.Current.Request.Url.Host+"/SignUp/"
2
Answers
System.IO.Path.GetFullPath method to get the full path of the current executing assembly.
System.Reflection.Assembly.GetExecutingAssembly().Location -To get the location of the current executing assembly.
And combining the custom domain and the current path to get the complete path.
To fetch the path name for the domain space names with JavaScript you can use
window.location.hostname
Reference taken from
MDN Web Docs
It seems like you are having issue with the URL being returned from your Azure Web App. The URL is returning the Azure Web App URL instead of the custom domain name.
To get the current path name using C#, you can use the HttpContext.Current.Request.Url property to get the URL of the current request.
You can then use the Scheme, Host, and Path properties to construct the URL you want.
In JavaScript, you can use the window.location object to get the URL of the current page. You can then use the protocol, host, and pathname properties to construct the URL you want.
You may also try using Azure Front Door to route traffic to your Azure Web App. Azure Front Door allows you to configure custom domains and URL paths, which can help you achieve the desired URL format.
Or Azure Application Gateway to rewrite the URL.
According to the documentation, you can create a rewrite rule with a condition that evaluates if the location header matches a specific pattern, and then rewrite the location header to a different value.