How do I view Log analytics data in application insights

charlie curtis 0 Reputation points
2025-10-30T09:19:44.1266667+00:00

I have created a Log analytics workspace and App Insights instance for a Function App (.net 9).

Records are being created from the FA in the workspace. I can see them

User's image

Problem is, nothing is showing in App Insights. I have tried creating a new instance of App Insights, but still blank

User's image

What have i done wrong?

program.cs in FA:

using Microsoft.Azure.Functions.Worker;

using Microsoft.Azure.Functions.Worker.Builder;

using Microsoft.Extensions.Configuration;

using Microsoft.Extensions.DependencyInjection;

using Microsoft.Extensions.Hosting;

using Microsoft.Extensions.Logging;

var builder = FunctionsApplication.CreateBuilder(args);

builder.ConfigureFunctionsWebApplication();

builder.Logging.Services.Configure

Azure Managed Applications
Azure Managed Applications
An Azure service that enables managed service providers, independent software vendors, and enterprise IT teams to deliver turnkey solutions through the Azure Marketplace or service catalog.
{count} votes

Answer recommended by moderator
  1. charlie curtis 0 Reputation points
    2025-11-05T12:33:32.4933333+00:00

    Sorted. partly down to my code, fixed as abouve

    and a bad bicep file.

    was

    
    resource
    	name
    	location
    	kind
    	properties
    		Application_Type
    		RetentionInDays
    		WorkspaceResourceId
    		IngestionMode
    		publicNetworkAccessForIngestion
    		publicNetworkAccessForQuery
    		DisableLocalAuth
    	}
    }
    
    Should have been:
    
    resource components_AppInsight 'microsoft.insights/components@2020-02-02' = {
      name: components_AppInsight_name
      location: rgLocation
      kind: 'web'
      properties: {
        Application_Type: 'web'
        RetentionInDays: 30
        WorkspaceResourceId: workspaces_log.id
        IngestionMode: 'LogAnalytics'
        publicNetworkAccessForIngestion: 'Enabled'
        publicNetworkAccessForQuery: 'Enabled'
        DisableLocalAuth: false
        Flow_Type: 'Redfield'
        Request_Source: 'IbizaAIExtension'
      }
    }
    
    

1 additional answer

Sort by: Most helpful
  1. Siva shunmugam Nadessin 3,025 Reputation points Microsoft External Staff Moderator
    2025-11-03T21:54:32.2133333+00:00

    Hello charlie curtis,

    In .NET 9 Azure Functions (isolated worker model) you need to fully wire logging to Application Insights manually as below code to get the logging pass to traces table.

    builder.Services.AddLogging(logging =>
    {
    logging.ClearProviders(); 
    logging.AddApplicationInsights(); 
    logging.SetMinimumLevel(LogLevel.Information); 
    });
    

     Add the above code before and make sure all the logging comes after this.

    builder.Build().Run();
     
    

    In Host.json file.

    Mark isEnabled to false as highlighted below

    User's image

    What "isEnabled": false Does

    • Disables sampling entirely.
    • Ensures every log, request, exception, and dependency is sent to Application Insights.
    • Useful for debugging, testing, or auditing, where you want full visibility.

     

    After making the changes deploy run your Azure Functions.

    Validate Application Insights & Logs Analytics Workspace using below queries to see if logs are flowing as expected.

    Application Insights Query

    traces
    | where timestamp > ago(1h)
    | where message contains "<log string to validate>"
    | order by timestamp desc
    

    Logs Analytics Workspace Query

    AppTraces
    | where TimeGenerated > ago(1h)
    | where Message contains "<log string to validate>"
    | order by TimeGenerated desc
     
    

    Reference Documents:

    https://learn.microsoft.com/en-us/azure/azure-functions/dotnet-isolated-process-guide?tabs=ihostapplicationbuilder%2Cwindows#managing-log-levels

    Kindly check and let us know if any questions?

    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.