I have create a Azure Mobile service based on .net Web Api and it has been running for a while and the tables work fine - returning data as expected.
I have recently added a custom API controller
public class FitbitWebApiController : ApiController
{
public ApiServices Services { get; set; }
// GET api/FitbitWebApi
public string Get()
{
Services.Log.Info("Hello from custom controller!");
return "Hello Friend";
}
}
I was expecting to be able to access this API by adding /Api/FitbitWebApi to my service URL.
When I ran this locally - yes localhost:118/api/FitBitWebApi worked fine but when I deploy this to Azure I get a 404 error instead.
In fact - when I look at the azure logging I get the following error message
Detailed Error Information: Module __DynamicModule_Microsoft.Owin.Host.SystemWeb.OwinHttpModule, Microsoft.Owin.Host.SystemWeb, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35_2ded9ca3-2357-42a5-8002-51c7cdf0ab1c Notification MapRequestHandler Handler ExtensionlessUrlHandler-Integrated-4.0 Error Code 0x00000000 Requested URL http://mobl_m_pedgservice:80/api/FitbitWebApi
Not sure how but now Azure seems to have added mobl_m to the beginning of my URL
Anyone got any ideas?
The Full error trace from the Azure logs is :
<h3>HTTP Error 404.0 - Not Found</h3>
<h4>The resource you are looking for has been removed, had its name changed, or is temporarily unavailable.</h4>
</div>
<div class="content-container">
<fieldset><h4>Most likely causes:</h4>
<ul> <li>The directory or file specified does not exist on the Web server.</li> <li>The URL contains a typographical error.</li> <li>A custom filter or module, such as URLScan, restricts access to the file.</li> </ul>
</fieldset>
</div>
<div class="content-container">
<fieldset><h4>Things you can try:</h4>
<ul> <li>Create the content on the Web server.</li> <li>Review the browser URL.</li> <li>Create a tracing rule to track failed requests for this HTTP status code and see which module is calling SetStatus. For more information about creating a tracing rule for failed requests, click <a href="http://go.microsoft.com/fwlink/?LinkID=66439">here</a>. </li> </ul>
</fieldset>
</div>
<div class="content-container">
<fieldset><h4>Detailed Error Information:</h4>
<div id="details-left">
<table border="0" cellpadding="0" cellspacing="0">
<tr class="alt"><th>Module</th><td> __DynamicModule_Microsoft.Owin.Host.SystemWeb.OwinHttpModule, Microsoft.Owin.Host.SystemWeb, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35_2ded9ca3-2357-42a5-8002-51c7cdf0ab1c</td></tr>
<tr><th>Notification</th><td> MapRequestHandler</td></tr>
<tr class="alt"><th>Handler</th><td> ExtensionlessUrlHandler-Integrated-4.0</td></tr>
<tr><th>Error Code</th><td> 0x00000000</td></tr>
</table>
</div>
<div id="details-right">
<table border="0" cellpadding="0" cellspacing="0">
<tr class="alt"><th>Requested URL</th><td> https://mobl_m_pedgservice:80/api/Fitbit</td></tr>
<tr><th>Physical Path</th><td> C:\Program Files (x86)\SiteExtensions\MobileServicesDotNet\1.0.478\api\Fitbit</td></tr>
<tr class="alt"><th>Logon Method</th><td> Anonymous</td></tr>
<tr><th>Logon User</th><td> Anonymous</td></tr>
</table>
<div class="clear"></div>
</div>
</fieldset>
</div>
<div class="content-container">
<fieldset><h4>More Information:</h4>
This error means that the file or directory does not exist on the server. Create the file or directory and try the request again.
<p><a href="http://go.microsoft.com/fwlink/?LinkID=62293&IIS70Error=404,0,0x00000000,9200">View more information »</a></p>
<p>Microsoft Knowledge Base Articles:</p>