ApiDiagnostic

class ApiDiagnostic : KotlinCustomResource

Manages a API Management Service API Diagnostics Logs.

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.Api;
import com.pulumi.azure.apimanagement.ApiArgs;
import com.pulumi.azure.apimanagement.inputs.ApiImportArgs;
import com.pulumi.azure.apimanagement.Logger;
import com.pulumi.azure.apimanagement.LoggerArgs;
import com.pulumi.azure.apimanagement.inputs.LoggerApplicationInsightsArgs;
import com.pulumi.azure.apimanagement.ApiDiagnostic;
import com.pulumi.azure.apimanagement.ApiDiagnosticArgs;
import com.pulumi.azure.apimanagement.inputs.ApiDiagnosticFrontendRequestArgs;
import com.pulumi.azure.apimanagement.inputs.ApiDiagnosticFrontendResponseArgs;
import com.pulumi.azure.apimanagement.inputs.ApiDiagnosticBackendRequestArgs;
import com.pulumi.azure.apimanagement.inputs.ApiDiagnosticBackendResponseArgs;
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 exampleApi = new Api("exampleApi", ApiArgs.builder()
.resourceGroupName(exampleResourceGroup.name())
.apiManagementName(exampleService.name())
.revision("1")
.displayName("Example API")
.path("example")
.protocols("https")
.import_(ApiImportArgs.builder()
.contentFormat("swagger-link-json")
.contentValue("http://conferenceapi.azurewebsites.net/?format=json")
.build())
.build());
var exampleLogger = new Logger("exampleLogger", LoggerArgs.builder()
.apiManagementName(exampleService.name())
.resourceGroupName(exampleResourceGroup.name())
.applicationInsights(LoggerApplicationInsightsArgs.builder()
.instrumentationKey(exampleInsights.instrumentationKey())
.build())
.build());
var exampleApiDiagnostic = new ApiDiagnostic("exampleApiDiagnostic", ApiDiagnosticArgs.builder()
.identifier("applicationinsights")
.resourceGroupName(exampleResourceGroup.name())
.apiManagementName(exampleService.name())
.apiName(exampleApi.name())
.apiManagementLoggerId(exampleLogger.id())
.samplingPercentage(5)
.alwaysLogErrors(true)
.logClientIp(true)
.verbosity("verbose")
.httpCorrelationProtocol("W3C")
.frontendRequest(ApiDiagnosticFrontendRequestArgs.builder()
.bodyBytes(32)
.headersToLogs(
"content-type",
"accept",
"origin")
.build())
.frontendResponse(ApiDiagnosticFrontendResponseArgs.builder()
.bodyBytes(32)
.headersToLogs(
"content-type",
"content-length",
"origin")
.build())
.backendRequest(ApiDiagnosticBackendRequestArgs.builder()
.bodyBytes(32)
.headersToLogs(
"content-type",
"accept",
"origin")
.build())
.backendResponse(ApiDiagnosticBackendResponseArgs.builder()
.bodyBytes(32)
.headersToLogs(
"content-type",
"content-length",
"origin")
.build())
.build());
}
}

Import

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

$ pulumi import azure:apimanagement/apiDiagnostic:ApiDiagnostic example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.ApiManagement/service/instance1/apis/api1/diagnostics/diagnostic1

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 (name) of the Diagnostics Logger.

Link copied to clipboard

The name of the API Management Service instance. Changing this forces a new API Management Service API Diagnostics Logs to be created.

Link copied to clipboard
val apiName: Output<String>

The name of the API on which to configure the Diagnostics Logs. Changing this forces a new API Management Service API Diagnostics Logs 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>

Identifier of the Diagnostics Logs. Possible values are applicationinsights and azuremonitor. Changing this forces a new API Management Service API Diagnostics Logs 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 API Diagnostics Logs should exist. Changing this forces a new API Management Service API Diagnostics Logs 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.