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

Application Insight in isolated Function app #1293

Closed
MianNajmi opened this issue Jan 25, 2023 · 3 comments
Closed

Application Insight in isolated Function app #1293

MianNajmi opened this issue Jan 25, 2023 · 3 comments

Comments

@MianNajmi
Copy link

MianNajmi commented Jan 25, 2023

I am facing issue in moving my function app code from in process to isolated process. Here is my application insight code which i am using in my startup.cs. i am not using APPINSIGHTS_INSTRUMENTATIONKEY configuration.

class Startup : FunctionsStartup
{
public override void ConfigureAppConfiguration(IFunctionsConfigurationBuilder builder)
{
builder.ConfigurationBuilder.AddApplicationInsightsSettings(applicationInsightsInstrumentationConectionstring);
}
public override void Configure(IFunctionsHostBuilder builder)
{
builder.Services.AddApplicationInsightsTelemetry();

}
}
Now i want to move it to program.cs for function app isolated process. i have tried different ways but it is not writing logs to application insight.

@ghost ghost assigned kshyju Jan 25, 2023
@kshyju
Copy link
Member

kshyju commented Jan 25, 2023

Can you share what you have tried in your isolated function bootstrapping code (Program.cs)?

@kshyju kshyju transferred this issue from Azure/azure-functions-host Jan 25, 2023
@ghost ghost assigned satvu Jan 25, 2023
@MianNajmi
Copy link
Author

MianNajmi commented Jan 25, 2023

i have tried this and it work fine in my local but when i deploy it in Azure, it did not log anything.

.ConfigureServices(services =>
{
services.AddApplicationInsightsTelemetryWorkerService(opt =>
{
opt.ConnectionString = applicationInsightsConectionString;
opt.DependencyCollectionOptions.EnableLegacyCorrelationHeadersInjection = true;
});
})

@jviau
Copy link
Contributor

jviau commented Jun 21, 2023

@MianNajmi we have a preview package for using app insights in the dotnet isolated worker. See #944 (comment)

@jviau jviau closed this as completed Jun 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants