title: Application Insights' Application Map doesn't show dependency calls
body: <p>We have added Application Insights to an Asp.Net 4.5.1 application deployed to an Azure Web App Service. It calls the database both using Entity Framework and SqlCommands.</p>
  
  <p>Application Insights is added both with javascript and in the backend. The javascript tracking is working, as can be seen both from calls tracked with Fiddler and the report data showing in the Azure portal.</p>
  
  <p>Requests to the web server are also shown in the reports but the Application Map chart doesn't show any dependency calls from the web server to the database nor any other dependencies.</p>
  
  <p>The ApplicationInsights.config is the standard one that you get from "Create new project" but with the InstrumentationKey element removed. The instrumentation key is set in global.asax as</p>
  
  <pre><code>Microsoft.ApplicationInsights.Extensibility.TelemetryConfiguration.Active.InstrumentationKey = applicationInsightsKey;
  </code></pre>
  
  <p>Additionally web config contains</p>
  
  <pre><code>&lt;system.web&gt;
      &lt;httpHandlers&gt;
        &lt;add path="CombineScriptsHandler.axd" verb="*" type="AjaxControlToolkit.CombineScriptsHandler, AjaxControlToolkit" /&gt;
      &lt;/httpHandlers&gt;
      &lt;httpModules&gt;
        &lt;add name="ApplicationInsightsWebTracking" type="Microsoft.ApplicationInsights.Web.ApplicationInsightsHttpModule, Microsoft.AI.Web" /&gt;
      &lt;/httpModules&gt;
  </code></pre>
  
  <p>...</p>
  
  <pre><code>  &lt;system.webServer&gt;
      &lt;modules runAllManagedModulesForAllRequests="true"&gt;
        &lt;remove name="ApplicationInsightsWebTracking" /&gt;
        &lt;add name="ApplicationInsightsWebTracking" type="Microsoft.ApplicationInsights.Web.ApplicationInsightsHttpModule, Microsoft.AI.Web" preCondition="managedHandler" /&gt;
      &lt;/modules&gt;
  </code></pre>
  
  <p>How can I get database query data from the web server tracked in AI?</p>
  
  <p><strong>Update</strong></p>
  
  <p>I upgraded the Web project to .Net 4.6.1 and started seeing some dependencies but not the actual sql query text. To remedy that I installed the AI Status Monitor extension in the App Service through the Azure portal. After that I saw absolutely no dependency calls and ApplicationInsightsExtension.log contained:</p>
  
  <blockquote>
    <p>9/29/2016 12:15:45 PM: [Verbose] Loading assembly from D:\home\SiteExtensions\Microsoft.ApplicationInsights.AzureWebSites\Microsoft.ApplicationInsights.WebSiteManager.dll<br>
    9/29/2016 12:15:45 PM: [Verbose] Starting Application Insights installation and configuration...<br>
    9/29/2016 12:15:46 PM: [Verbose] Loading assembly from D:\home\SiteExtensions\Microsoft.ApplicationInsights.AzureWebSites\Microsoft.ApplicationInsights.WebSiteManager.dll<br>
    9/29/2016 12:15:46 PM: [Verbose] Starting Application Insights Profiler configuration...<br>
    9/29/2016 12:15:46 PM: [Verbose] Current processor architecture: x86<br>
    9/29/2016 12:15:46 PM: [Verbose] Starting to download/install 'Microsoft.ApplicationInsights.Agent_x86' nuget package from D:\home\SiteExtensions\Microsoft.ApplicationInsights.AzureWebSites\appinsights...<br>
    9/29/2016 12:15:46 PM, [Verbose] Installing 'Microsoft.ApplicationInsights.Agent_x86', version '2.0.0' ...<br>
    9/29/2016 12:15:47 PM, [Verbose] Installed 'Microsoft.ApplicationInsights.Agent_x86', version '2.0.0'.<br>
    9/29/2016 12:15:47 PM: [Verbose] End of 'Microsoft.ApplicationInsights.Agent_x86' nuget package download/install.<br>
    9/29/2016 12:15:47 PM: [Verbose] Ready to copy files from D:\home\SiteExtensions\Microsoft.ApplicationInsights.AzureWebSites\Packages\Microsoft.ApplicationInsights.Agent_x86.2.0.0\content\RTIA\x86 to D:\home\SiteExtensions\Microsoft.ApplicationInsights.AzureWebSites\Agent<br>
    9/29/2016 12:15:47 PM: [Verbose] Microsoft.ApplicationInsights.Extensions.Base_x86.dll.Name was copied.<br>
    9/29/2016 12:15:47 PM: [Verbose] Microsoft.ApplicationInsights.ExtensionsHost_x86.dll.Name was copied.<br>
    9/29/2016 12:15:47 PM: [Verbose] Microsoft.Diagnostics.Instrumentation.Extensions.Base.dll.Name was copied.<br>
    9/29/2016 12:15:47 PM: [Verbose] Microsoft.InstrumentationEngine.Extensions.config.Name was copied.<br>
    9/29/2016 12:15:47 PM: [Verbose] MicrosoftInstrumentationEngine_x86.dll.Name was copied.<br>
    9/29/2016 12:15:47 PM: [Verbose] End of Application Insights Profiler configuration.<br>
    9/29/2016 12:15:47 PM: [Verbose] Loading config from D:\home\site\wwwroot\ApplicationInsights.config<br>
    <strong>9/29/2016 12:15:47 PM: [Verbose] Application is already instrumented with Application Insights version: 2.1.0.0</strong><br>
    9/29/2016 12:15:47 PM: [Verbose] End of Application Insights installation and configuration.  </p>
  </blockquote>
  
  <p>So how can I get dependency logging with sql query text logging?</p>
  
  <p>I have a hunch this would work if I had the telemetry key in the applicationinsights.config file but I want to set that programmatically from the app settings.</p>