Skip to content
DocsTry Aspire
DocsTry

AzureApplicationInsightsExtensions Methods

ClassMethods4 members
Provides extension methods for adding the Azure ApplicationInsights resources to the application model.
AddAzureApplicationInsights(IDistributedApplicationBuilder, string)Section titled AddAzureApplicationInsights(IDistributedApplicationBuilder, string)extensionIResourceBuilder<AzureApplicationInsightsResource>
Adds an Azure Application Insights resource to the application model.
public static class AzureApplicationInsightsExtensions
{
public static IResourceBuilder<AzureApplicationInsightsResource> AddAzureApplicationInsights(
this IDistributedApplicationBuilder builder,
string name)
{
// ...
}
}
builderIDistributedApplicationBuilderThe Hosting.IDistributedApplicationBuilder.
namestringThe name of the resource. This name will be used as the connection string name when referenced in a dependency.
IResourceBuilder<AzureApplicationInsightsResource>A reference to the ApplicationModel.IResourceBuilder`1.
AddAzureApplicationInsights(IDistributedApplicationBuilder, string, IResourceBuilder<AzureLogAnalyticsWorkspaceResource>)Section titled AddAzureApplicationInsights(IDistributedApplicationBuilder, string, IResourceBuilder<AzureLogAnalyticsWorkspaceResource>)extensionIResourceBuilder<AzureApplicationInsightsResource>
Adds an Azure Application Insights resource to the application model.
public static class AzureApplicationInsightsExtensions
{
public static IResourceBuilder<AzureApplicationInsightsResource> AddAzureApplicationInsights(
this IDistributedApplicationBuilder builder,
string name,
IResourceBuilder<AzureLogAnalyticsWorkspaceResource>? logAnalyticsWorkspace)
{
// ...
}
}
builderIDistributedApplicationBuilderThe Hosting.IDistributedApplicationBuilder.
namestringThe name of the resource. This name will be used as the connection string name when referenced in a dependency.
logAnalyticsWorkspaceIResourceBuilder<AzureLogAnalyticsWorkspaceResource>A resource builder for the log analytics workspace.
IResourceBuilder<AzureApplicationInsightsResource>A reference to the ApplicationModel.IResourceBuilder`1.
WithLogAnalyticsWorkspace(IResourceBuilder<AzureApplicationInsightsResource>, BicepOutputReference)Section titled WithLogAnalyticsWorkspace(IResourceBuilder<AzureApplicationInsightsResource>, BicepOutputReference)extensionIResourceBuilder<AzureApplicationInsightsResource>
Configures the Application Insights resource to use an existing Log Analytics Workspace via a Azure.BicepOutputReference.
public static class AzureApplicationInsightsExtensions
{
public static IResourceBuilder<AzureApplicationInsightsResource> WithLogAnalyticsWorkspace(
this IResourceBuilder<AzureApplicationInsightsResource> builder,
BicepOutputReference workspaceId)
{
// ...
}
}
builderIResourceBuilder<AzureApplicationInsightsResource>The resource builder for AzureApplicationInsightsResource.
workspaceIdBicepOutputReferenceThe Azure.BicepOutputReference for the Log Analytics Workspace resource id.
IResourceBuilder<AzureApplicationInsightsResource>The ApplicationModel.IResourceBuilder`1 for chaining.
This overload is not available in polyglot app hosts. Use the overload that accepts an ApplicationModel.IResourceBuilder`1 instead.
WithLogAnalyticsWorkspace(IResourceBuilder<AzureApplicationInsightsResource>, IResourceBuilder<AzureLogAnalyticsWorkspaceResource>)Section titled WithLogAnalyticsWorkspace(IResourceBuilder<AzureApplicationInsightsResource>, IResourceBuilder<AzureLogAnalyticsWorkspaceResource>)extensionIResourceBuilder<AzureApplicationInsightsResource>
Configures the Application Insights resource to use the specified Log Analytics Workspace resource.
public static class AzureApplicationInsightsExtensions
{
public static IResourceBuilder<AzureApplicationInsightsResource> WithLogAnalyticsWorkspace(
this IResourceBuilder<AzureApplicationInsightsResource> builder,
IResourceBuilder<AzureLogAnalyticsWorkspaceResource> logAnalyticsWorkspace)
{
// ...
}
}
builderIResourceBuilder<AzureApplicationInsightsResource>The resource builder for AzureApplicationInsightsResource.
logAnalyticsWorkspaceIResourceBuilder<AzureLogAnalyticsWorkspaceResource>The resource builder for the Azure.AzureLogAnalyticsWorkspaceResource.
IResourceBuilder<AzureApplicationInsightsResource>The ApplicationModel.IResourceBuilder`1 for chaining.