microsoft / ApplicationInsights-node.js

Microsoft Application Insights SDK for Node.js
MIT License
321 stars 138 forks source link

Fix SDK Already Exists Detection #1284

Closed JacksonWeber closed 4 months ago

JacksonWeber commented 4 months ago

Previous SDK Already Exists check failed upon testing in App Service Linux environments as there were instances of the old agent that broke my check.

New check looks for the "applicationinsights" package specifically under the "/home/site/wwwroot" path on Node versions > 8.9 (where the paths parameter was introduced).

Tested this change detects the path of the user's SDK in both Windows and Linux App Services from multiple starting paths inside and outside of the "/home" path. Also ensured that the check fails as expected if the application deployed to the App Service does not include the applicationinsights package.