Transitioned from Mobile Service to Azure Mobile Apps. Custom API calls return 404 even though authentication and migrations succeed. Example new code:
[MobileApi]
public class SampleEndpoint : ApiController {
[HttpPost, Route("api/sample/execute")]
public async Task<IHttpActionResult> ExecuteCommand(string inputParam) {
return Ok(inputParam + " processed");
}
}
hey, have u checked if your routing settings in web apiconfig are in place? sometimes azure mobile apps mishandls routing so your endpoint isn’t reached. what other changes have u tried? keen to know more.
hey, try checking if u set the route correctly in startup. i fixed mine by adding a RoutePrefix attribute to match the api device. might be the issue for u, as sometimes azure needs a bit more explicit routing
In my experience, such errors often stem from the API not being properly registered within the application pipeline even though the code is correct. It can help to verify that the WebApiConfig is correctly mapping your custom routes and not conflicting with any default settings. I encountered a similar issue that was resolved by explicitly ensuring that the custom API controllers were recognized in the assembly scanning process during startup. Additionally, double-checking the URL casing can be crucial, as some environments are case-sensitive. These practices helped me troubleshoot effectively.
hey, i noticed sometimes azure may not catch custom routes due to subtle casing or ordering in config. have u tried enabling more verbose diagnostics to see what it’s really hitting? curious how your startup pipeline is arranged, might be a clue lurking there
hey, maybe review your endpoint naming in config. i once fixed a similar 404 by adjusting assembly scanning and ensuring my controller name matches the route patterns. hope this points u in the right direction!