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) { // ... }}Parameters
builderIDistributedApplicationBuilderThe Hosting.IDistributedApplicationBuilder.namestringThe name of the resource. This name will be used as the connection string name when referenced in a dependency.Returns
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) { // ... }}Parameters
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.Returns
IResourceBuilder<AzureApplicationInsightsResource>A reference to the ApplicationModel.IResourceBuilder`1.Remarks
This overload is not available in polyglot app hosts. Use
AzureApplicationInsightsExtensions.AddAzureApplicationInsights and AzureApplicationInsightsExtensions.WithLogAnalyticsWorkspace instead.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) { // ... }}Parameters
builderIResourceBuilder<AzureApplicationInsightsResource>The resource builder for AzureApplicationInsightsResource.workspaceIdBicepOutputReferenceThe Azure.BicepOutputReference for the Log Analytics Workspace resource id.Returns
IResourceBuilder<AzureApplicationInsightsResource>The ApplicationModel.IResourceBuilder`1 for chaining.Remarks
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) { // ... }}Parameters
builderIResourceBuilder<AzureApplicationInsightsResource>The resource builder for AzureApplicationInsightsResource.logAnalyticsWorkspaceIResourceBuilder<AzureLogAnalyticsWorkspaceResource>The resource builder for the Azure.AzureLogAnalyticsWorkspaceResource.Returns
IResourceBuilder<AzureApplicationInsightsResource>The ApplicationModel.IResourceBuilder`1 for chaining.