Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

After integrating azure app with AppInsights noticed failing dependency call to iisnodestats.azurewebsites.net #547

Open
SergeyKanzhelev opened this issue Dec 2, 2016 · 2 comments

Comments

@SergeyKanzhelev
Copy link

See microsoft/ApplicationInsights-node.js#144 for information. Somehow node.js starting making calls to http://iisnodestats.azurewebsites.net:80/ when Web Server Logging turned on for Azure Web App.

@jvano
Copy link

jvano commented Dec 14, 2017

This issue is specific to Azure App Service in which the D:\Program Files (x86)\iisnode\interceptor.js was customized to support console output logging to files on disk and to integrate with
Azure portal settings for diagnostics which are stored in the ..\diagnostics\settings.json file.

The problem is no longer present since the following code is commented in the interceptor.js in Azure App Service worker roles:

/*
    try {
        fs.readFile(process.env.systemdrive + '\\home\\site\\wwwroot\\package.json', { encoding: 'utf8' }, function (error, data) {
            var json = {};
            if (!error) {
                try {
                    var packageJson = JSON.parse(data);
                    if (typeof packageJson === 'object') {
                        json.dependencies = packageJson.dependencies;
                        json.devDependencies = packageJson.devDependencies;
                        json.engines = packageJson.engines;
                    }
                }
                catch (e) {
                    // ignore - don't capture package.json but still report activation
                }
            }

            try {
                http.request({
                    hostname: 'iisnodestats.azurewebsites.net',
                    port: 80,
                    path: '/4f66797cbb144cae967f9923eaaf0fcd/' + process.env.APP_POOL_ID,
                    method: 'POST',
                    headers: { 'Content-Type': 'application/json' }
                }).end(JSON.stringify(json));
            }
            catch (e) {
                // ignore - best effort
            }
        });
    }
    catch (e) {
        // ignore - best effort
    }
*/

@SergeyKanzhelev
Copy link
Author

SergeyKanzhelev commented Dec 18, 2017

Thank you for detailed explanation!
CC: @davidebbo - should this code be completely removed than instead of commenting out?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants