ASP.NET MVC application in IIS without port number added in default
web site but not hitting the action methods and getting 404 error.
Actually, based on your shared code snippet and description I have tried to simulate your scenario and ended with expected result.
I have following project structure:

Controller:
public class HomeController : Controller
{
public ActionResult Index()
{
return View();
}
[HttpPost]
[Route("Home/TitleAccessUpdate")]
public JsonResult TitleAccessUpdate(int? Id)
{
return Json($"Access Id {Id} has been updated!");
}
}
View:
<strong><span id="appendHere"></span></strong></>
<hr />
<input id="accessId" />
<button type="button" name="submitButton" value="Edit" class="btn btn-primary"
onclick="GetAjaxResponse()">
Submit Request
</button>
@section scripts {
<script>
function GetAjaxResponse() {
var idToUpdate = document.getElementById("accessId").value;
console.log(idToUpdate);
var localUrl = "https://localhost:7251/Home/TitleAccessUpdate";
var publishUrl = "https://mypublishdapp.azurewebsites.net/Home/TitleAccessUpdate";
$.ajax({
type: "POST",
url: localUrl,
data: "Id=" + idToUpdate,
dataType: "json",
success: function (data) {
$("#appendHere").html(data);
},
error: function (xhr, status, error) {
alert('Data was not sent to backend!');
}
});
}
</script>
}
Simulation Test Local & Server:


What to double check:
First of all, please double check your projct working in local environment as expected. I have tried same as yours and working as expected.
Most importantly, your IIS port should not be the hurdle in this scenario. On top of this, try to call that URL from postman, if the URL correct then you should get response from postman if not then your published app URL might causing the issue. You can try both without defining the port and without th port number.
Furthermore, In my test both working fine. Based on your information it seems that your URL is not correct and please double check it if the port is not used by other program in that scenario, your app might have a port conflic issue.
Note: You can refer to this sample for more details. In addition, please check how to configure IIS for asp.net core project.