Diagnostic

class Diagnostic : KotlinCustomResource

Manages an API Management Service Diagnostic.

Example Usage

package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.azure.core.ResourceGroup;
import com.pulumi.azure.core.ResourceGroupArgs;
import com.pulumi.azure.appinsights.Insights;
import com.pulumi.azure.appinsights.InsightsArgs;
import com.pulumi.azure.apimanagement.Service;
import com.pulumi.azure.apimanagement.ServiceArgs;
import com.pulumi.azure.apimanagement.Logger;
import com.pulumi.azure.apimanagement.LoggerArgs;
import com.pulumi.azure.apimanagement.inputs.LoggerApplicationInsightsArgs;
import com.pulumi.azure.apimanagement.Diagnostic;
import com.pulumi.azure.apimanagement.DiagnosticArgs;
import com.pulumi.azure.apimanagement.inputs.DiagnosticFrontendRequestArgs;
import com.pulumi.azure.apimanagement.inputs.DiagnosticFrontendResponseArgs;
import com.pulumi.azure.apimanagement.inputs.DiagnosticBackendRequestArgs;
import com.pulumi.azure.apimanagement.inputs.DiagnosticBackendResponseArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
var exampleResourceGroup = new ResourceGroup("exampleResourceGroup", ResourceGroupArgs.builder()
.location("West Europe")
.build());
var exampleInsights = new Insights("exampleInsights", InsightsArgs.builder()
.location(exampleResourceGroup.location())
.resourceGroupName(exampleResourceGroup.name())
.applicationType("web")
.build());
var exampleService = new Service("exampleService", ServiceArgs.builder()
.location(exampleResourceGroup.location())
.resourceGroupName(exampleResourceGroup.name())
.publisherName("My Company")
.publisherEmail("company@mycompany.io")
.skuName("Developer_1")
.build());
var exampleLogger = new Logger("exampleLogger", LoggerArgs.builder()
.apiManagementName(exampleService.name())
.resourceGroupName(exampleResourceGroup.name())
.applicationInsights(LoggerApplicationInsightsArgs.builder()
.instrumentationKey(exampleInsights.instrumentationKey())
.build())
.build());
var exampleDiagnostic = new Diagnostic("exampleDiagnostic", DiagnosticArgs.builder()
.identifier("applicationinsights")
.resourceGroupName(exampleResourceGroup.name())
.apiManagementName(exampleService.name())
.apiManagementLoggerId(exampleLogger.id())
.samplingPercentage(5)
.alwaysLogErrors(true)
.logClientIp(true)
.verbosity("verbose")
.httpCorrelationProtocol("W3C")
.frontendRequest(DiagnosticFrontendRequestArgs.builder()
.bodyBytes(32)
.headersToLogs(
"content-type",
"accept",
"origin")
.build())
.frontendResponse(DiagnosticFrontendResponseArgs.builder()
.bodyBytes(32)
.headersToLogs(
"content-type",
"content-length",
"origin")
.build())
.backendRequest(DiagnosticBackendRequestArgs.builder()
.bodyBytes(32)
.headersToLogs(
"content-type",
"accept",
"origin")
.build())
.backendResponse(DiagnosticBackendResponseArgs.builder()
.bodyBytes(32)
.headersToLogs(
"content-type",
"content-length",
"origin")
.build())
.build());
}
}

Import

API Management Diagnostics can be imported using the resource id, e.g.

$ pulumi import azure:apimanagement/diagnostic:Diagnostic example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/mygroup1/providers/Microsoft.ApiManagement/service/instance1/diagnostics/applicationinsights

Properties

Link copied to clipboard

Always log errors. Send telemetry if there is an erroneous condition, regardless of sampling settings.

Link copied to clipboard

The id of the target API Management Logger where the API Management Diagnostic should be saved.

Link copied to clipboard

The Name of the API Management Service where this Diagnostic should be created. Changing this forces a new resource to be created.

Link copied to clipboard

A backend_request block as defined below.

Link copied to clipboard

A backend_response block as defined below.

Link copied to clipboard

A frontend_request block as defined below.

Link copied to clipboard

A frontend_response block as defined below.

Link copied to clipboard

The HTTP Correlation Protocol to use. Possible values are None, Legacy or W3C.

Link copied to clipboard
val id: Output<String>
Link copied to clipboard
val identifier: Output<String>

The diagnostic identifier for the API Management Service. At this time the supported values are applicationinsights and azuremonitor. Changing this forces a new resource to be created.

Link copied to clipboard
val logClientIp: Output<Boolean>

Log client IP address.

Link copied to clipboard

The format of the Operation Name for Application Insights telemetries. Possible values are Name, and Url. Defaults to Name.

Link copied to clipboard
val pulumiChildResources: Set<KotlinResource>
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

The Name of the Resource Group where the API Management Service exists. Changing this forces a new resource to be created.

Link copied to clipboard

Sampling (%). For high traffic APIs, please read this documentation to understand performance implications and log sampling. Valid values are between 0.0 and 100.0.

Link copied to clipboard
val urn: Output<String>
Link copied to clipboard
val verbosity: Output<String>

Logging verbosity. Possible values are verbose, information or error.