locked
[Node.js][Mobile Apps] Azure Mobile Apps - Scheduler doesn't work after migration from Azure Mobile Services RRS feed

  • Question

  • Hi,

    Since I migrated from Azure Mobile Service to Azure Mobile Apps, the script I had in a scheduler doesn't work anymore. The script is a simple insert function:

    function AddData() {

        

        var version = tables.getTable('Versions');

            var ver = {            

                version: '6',

            };

            version.insert(ver, {

                success: function(results) {

                    console.log(results);

                }

            });

    }

    I tried to add the following before the function, but it still doesn't work:

    var express = require('express'),
        azureMobileApps = require('azure-mobile-apps');

    var app = express(),
        mobile = azureMobileApps();

    app.use(mobile);

    (and I tried using mobile.tables.getTable('Versions') and mobile.table('Versions') instead of tables.getTable('Versions') but neither works)

    On the portal the scheduler status shows successful, but the record is not inserted. 

    I've pasted below the error message that shows up in the streaming log. It's weird that it seems to reference an old version of the script (the script at the time of migration, which I've since changed)...in the last line of the error message, the itemCreated is different from what I am inserting above.

    </head>

    <body>

    <div id="content">

    <div>

    <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>

    <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>

    <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>

    <fieldset><h4>Detailed Error Information:</h4>

    <div id="details-left">

    <table border="0" cellpadding="0" cellspacing="0">

    <tr><th>Module</th><td>&nbsp;&nbsp;&nbsp;IIS Web Core</td></tr>

    <tr><th>Notification</th><td>&nbsp;&nbsp;&nbsp;MapRequestHandler</td></tr>

    <tr><th>Handler</th><td>&nbsp;&nbsp;&nbsp;StaticFile</td></tr>

    <tr><th>Error Code</th><td>&nbsp;&nbsp;&nbsp;0x80070002</td></tr>

     

    </table>

    </div>

    <div id="details-right">

    <table border="0" cellpadding="0" cellspacing="0">

    <tr><th>Requested URL</th><td>&nbsp;&nbsp;&nbsp;https://mobl_m_version1:80/jobs/AddData</td></tr>

    <tr><th>Physical Path</th><td>&nbsp;&nbsp;&nbsp;D:\home\site\wwwroot\jobs\AddData</td></tr>

    <tr><th>Logon Method</th><td>&nbsp;&nbsp;&nbsp;Anonymous</td></tr>

    <tr><th>Logon User</th><td>&nbsp;&nbsp;&nbsp;Anonymous</td></tr>

     

    </table>

    <div></div>

    </div>

    </fieldset>

    </div>

     

    <div>

    <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&amp;IIS70Error=404,0,0x80070002,9200">View more information &raquo;</a></p>

    <p>Microsoft Knowledge Base Articles:</p>

     

     

    </fieldset>

    </div>

    </div>

    </body>

    </html>

    {"timeCreated":"2016-05-09T10:35:07.196Z","type":"information","source":"/scheduler/AddData.js","message":"{ id: 'B7E837D2-8A63-4FA0-BDD3-781B9B467CC4',\n  version: '213' }"}

    Could anyone please help me with this? Thanks!


    person who needs help



    Monday, May 9, 2016 11:04 AM

Answers

  • I have a quick test on my side and it works fine. As you got 404 Not Found error, you can try to use KUDU console site or Visual Studio online extension of your app services to check whether your scheduled job script is still exist in your application.

    And you can 

    1. Log into the Azure Portal.
    2. Select Browse>, enter Schedule in the Filter box, then select Scheduler Collections.

    to find your scheduled job scripts and setting after the migration. You can use the HTTP request settings in the Action settings section to build the HTTP requests for test. 

     
    Wednesday, May 11, 2016 5:55 AM

All replies

  • Hi there,

    The document at https://azure.microsoft.com/en-us/documentation/articles/app-service-mobile-migrating-from-mobile-services/ should contain the instructions you need.

    It's important to note that clicking the "Migrate to App Service" button did not upgrade you to the newer Azure Mobile Apps product - your app still uses the older Azure Mobile Services product, but is now hosted on the newer Web Apps platform. Your app should still continue to function as it did previously.

    I hope this helps!

    Dale

    Monday, May 9, 2016 6:26 PM
  • Hi Dale,

    Thank you for the response. I tested my scripts some more and I realized what seems to be happening is none of the changes I make (to both the insert/delete/update/read scripts for the tables and the scheduler scripts) are run, even though they are saved. The documentation doesn't mention anything about that. Do you know what I can do to fix this?

    Thanks!


    person who needs help

    Wednesday, May 11, 2016 3:11 AM
  • I have a quick test on my side and it works fine. As you got 404 Not Found error, you can try to use KUDU console site or Visual Studio online extension of your app services to check whether your scheduled job script is still exist in your application.

    And you can 

    1. Log into the Azure Portal.
    2. Select Browse>, enter Schedule in the Filter box, then select Scheduler Collections.

    to find your scheduled job scripts and setting after the migration. You can use the HTTP request settings in the Action settings section to build the HTTP requests for test. 

     
    Wednesday, May 11, 2016 5:55 AM